Hodo Posted July 7, 2007 Share Posted July 7, 2007 Here is the code $query = "INSERT INTO Ranscore SET pname = '$name', pscore = '$score', pdate = '$date' WHERE id = '$id' "; $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); $rows = mysql_affected_rows($result); and here is the response: mysql_affected_rows(): supplied argument is not a valid MySQL-Link resource I just wanted to see if $rows was > 0 what am I doing wrong? Quote Link to comment https://forums.phpfreaks.com/topic/58858-mysql_affected_rows-problem/ Share on other sites More sharing options...
AndyB Posted July 7, 2007 Share Posted July 7, 2007 Wrong argumentfor the function. Just use mysql_affected_rows() http://www.php.net/mysql_affected_rows Quote Link to comment https://forums.phpfreaks.com/topic/58858-mysql_affected_rows-problem/#findComment-292068 Share on other sites More sharing options...
fenway Posted July 10, 2007 Share Posted July 10, 2007 Or the query failed.... Quote Link to comment https://forums.phpfreaks.com/topic/58858-mysql_affected_rows-problem/#findComment-294635 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.