autoincrement array values results in Undefined index - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: autoincrement array values results in Undefined index (/showthread.php?tid=12150) |
autoincrement array values results in Undefined index - El Forum - 10-08-2008 [eluser]K.OS[/eluser] Hi, i have a tiny problem with an array, this array will cotain database entries by date separated in a negative and positive counter: Code: foreach ($votes as $key => $value) { Code: A PHP Error was encountered i know that everytime i try to increment the value for a new date, the key for the array does not exist, which actually causes the problem, but i have no idea how to solve this. autoincrement array values results in Undefined index - El Forum - 10-08-2008 [eluser]xwero[/eluser] What about Code: if($value->voting == 1) { |