[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) {
$thisDay = date('y-m-j',strtotime($votes[$key]->timeEnter));
if($value->voting == 1) {
$voteCount[$thisDay]['pos']++;
}else{
$voteCount[$thisDay]['neg']++;
}
}
Whenever $thisDay changes to a new date, i get an error:
Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined index: pos
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.