When I use phpmyadmin, and run this sql query, it will tell me that it affected X amount of rows (lets say 10).
However, when i run my script, it doesnt' tell me that.
function db_query($query)
{
$result = mysql_query($query) or db_error($query, mysql_errno(), mysql_error());
return $result;
}
function db_num_rows($db_query) {
return mysql_num_rows($db_query);
}
$banner_history_query = db_query("delete from banners_history where banners_user_ip ='" . $ip_address . "'");
echo "banner_history_query = $banner_history_query";
$banner_history_num_rows = db_num_rows($banner_history_query);
echo "banner histtory delete ip = $banner_history_num_rows";
and it outputs this:
banner_history_query = 1
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/mysite/public_html/design/includes/database.php on line 32
banner histtory delete ip =
and line 32 is :
return mysql_num_rows($db_query);
any thoughts ?
Thansk.