php - "Notice: Undefined index" on some values when pushing to array -


i adding values keys array:

public function adddata($key, $value){     $this->data[$key] =  $value; }  //this line y in class $dataholder->adddata($fieldnames[$i], $row{$fieldnames[$i]}); 

it works of time.

notice: undefined index [keyvalue] in x.php in line y 

the array empty , values , keys database table.

most of fields inserted without problem, gives error? ideas on why works sometimes?

delcare $this->data = array(); above function

or

it might happen when key or value passing empty value function database.


Comments

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -