I am trying to update my table using while loop, unfortunately it is only updating the first record. Why can I not update the whole 27000 records?
Thank you.
<?php
$sql = "SELECT * FROM spammers ORDER BY spamID;";
$res = mysql_query($sql);
if(!$res) {
trigger_error("Could not connect to the database!\n <br/>MySQL Error: " . mysqli_connect_error());
}
while ($rows=mysql_fetch_assoc($res)) {
$sql = "UPDATE spammers
SET abc='". 5252 ."'
WHERE spamID ='".$rows['spamID']."';";
$res = mysql_query($sql);
if(!$res) {
die(" Could not query the database: <br/>". mysql_error() );
}
}
?>