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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Bickey Posted January 12, 2011 Author Share Posted January 12, 2011 You're the man! Thanks, Bickey. Quote Link to comment 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.