Hello,
I am making a simple ad rotator for my companies website and for some reason I have been having these wierd mysql_affected_rows() errors:
Here is some sample code of were I am going to delete a banner:
$sql = "DELETE FROM $ads WHERE name = '$name'";
$query = mysql_query($sql, $conn);
$num = mysql_affected_rows($query);
if($num == 0) {
error_message("Could Not Delete!");
} else {
alert_goto("Deleted","main.php");
}
So here is what it does, it does delete the banner! But, the error_message() pops up saying the banner was not deleted then at the top there is the following statement:
Warning: mysql_affected_rows(): supplied argument is not a valid MySQL-Link resource in /home/cool-palace/public_html/ads/admin/dodelete.php on line 15
(Line 15 is shown above when I call the function)
Thanks,
Brian