Bickey Posted January 12, 2011 Share Posted January 12, 2011 I'm getting this error when I use the following code. Could someone help me to fix this. Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource $result =sprintf("SELECT * FROM my_tbl WHERE username ='%s' || email= '%s'", mysql_real_escape_string($username), mysql_real_escape_string($email)); $resultfin = mysql_query($result); if (mysql_num_rows ($resultfin) > 0){ Thanks, Bickey. Link to comment https://forums.phpfreaks.com/topic/224157-need-help-in-fixing-this-code/ Share on other sites More sharing options...
fxuser Posted January 12, 2011 Share Posted January 12, 2011 try changing $resultfin = mysql_query($result); to $resultfin = mysql_query($result) or die(mysql_error()); so u can get a msg about the error on your query Link to comment https://forums.phpfreaks.com/topic/224157-need-help-in-fixing-this-code/#findComment-1158263 Share on other sites More sharing options...
Bickey Posted January 12, 2011 Author Share Posted January 12, 2011 You're the man! Thanks, Bickey. Link to comment https://forums.phpfreaks.com/topic/224157-need-help-in-fixing-this-code/#findComment-1158266 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.