I am trying to define variables inside a counter for later use. Check this out:
$i = 0;
while($candidatelist = mysql_fetch_array($candidates))
$candidateid = $candidatelist['id'];
$candidates comes from a database. The $candidatelist array returns 2 results.
What i want to do is add the counter variable to the $candidateid variable so I can separate them out for later use.
Like I would like $candidateid1, $candidateid2 etc for use in an ajax function. For the life of me I can't get it to work.
I tried things like.
$candidateid.$i = $candidateid.$i;
$candidateid + $i;
But those doesn't seem to work. This seems like a simple thing to do, but i just can't get it to work.
Can anyone help?