Problem with mysql_fetch_array after first loop...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've made a little programme that deletes expired records from database tables. The troublesome bit looks like this...

$query = "SELECT ic FROM ic_ic WHERE date <= CURDATE()";
$result = mysql_query($query) or die("Unable to get old campaigns because " . mysql_error());
while ($row = mysql_fetch_array($result)){
extract($row);
...delete records from tables where ic = ic
}


It works fine for the fitst value of $ic, but on the second time around I get an error message saying that line [starting with "while..."] is not a valid MySQL resource. This really puzzles me because it works one time around, but not after that.

$ic, incidentally, is a string originally generated from the timestamp (ie. getdate[0]) - could this be causing a problem?

Many thanks!

Jeffrey

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux