Problem with a for loop...

From: Date: Thu, 16 Jan 2003 13:39:33 +0000
Subject: Problem with a for loop...
Groups: php.general 
Request: Send a blank email to php-general+get-131853@lists.php.net to get a copy of this message
I have al for loop that looks something like this: $checkCurrName = "SELECT imgName FROM $db_img ORDER BY imgName DESC"; $resultCurrName = mysql_query($checkCurrName, $db); for ($i = 0; $i < $n; $i++){ list($currName) = mysql_fetch_row($resultCurrName); $newName = $currName++; print($newName); //insert $newName into db } The problem is that I get the first printout right (the current value in the database + 1) but all after that equal the first one, it looks like i’m not getting the newest value from the database after the first loop. Any Ideas about this Thanks, David

« previous php.general (#131853) next »