See this: - http://uk2.php.net/mysql_num_rows... instead of mysql_num_rows()To retrieve the number of rows affected by a INSERT, UPDATE or DELETE query, use mysql_affected_rows().
Have got the following code in my script:
$query = "UPDATE Petitions SET signatures='$sigs', lastupdate='NOW()' WHERE pet_id='$pid'";
$result = @mysql_query ($query);
echo "Num $num <br>";
$num = @mysql_num_rows ($result);
echo "Num $num <br>";
Problems is that even though the tables are updated with the correct values, the value of $num remains undefined. Anyone got any ideas?
![]()
See this: - http://uk2.php.net/mysql_num_rows... instead of mysql_num_rows()To retrieve the number of rows affected by a INSERT, UPDATE or DELETE query, use mysql_affected_rows().
Damn, school boy error, cheers!![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks