Jump to content

undefined offset help


ashy

Recommended Posts

a.) that's not a for loop thats a while loop.

b.) you don't have $++ in your code you have $i++ (but thats probably just a typo)

c.) since $va is an array, you don't really need the $i variable at all.

 

$va = array();
while($row = mysql_fetch_array($result)) {
   $va[] = $row['id'];
}

d.) you are getting undefined offset because you are attempting to access an item in the array that doesn't exist.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.