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 - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -