~n[EO]n~ Posted October 31, 2007 Share Posted October 31, 2007 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource on line 54 code is like this <?php $sSql="Select mem_password from ".MEMBER_TABLE." where mem_email = ".$_REQUEST['mem_email']; //echo $sSql; $result=mysql_query($sSql); if(mysql_num_rows($result)!=0) { $array=mysql_fetch_array($result); $yourpassword = $array['mem_password']; echo $yourpassword; $formail_pwd = TRUE; } else { $app->error_display_type=2; $app->error("E-mail id could not be found."); $formail_pwd = TRUE; } ?> line 54 is this if(mysql_num_rows($result)!=0) thanks Quote Link to comment https://forums.phpfreaks.com/topic/75464-solved-cant-figure-this-out-warning-mysql_num_rows-supplied-argument-is-not-a-va/ Share on other sites More sharing options...
Zane Posted October 31, 2007 Share Posted October 31, 2007 Your problem is in your SQL statement most likely it's because you don't have quotes around your REQUEST variable but just in case change this $result=mysql_query($sSql); to this $result=mysql_query($sSql) or die("Your have an error because: " . mysql_error()); and come back with the results Quote Link to comment https://forums.phpfreaks.com/topic/75464-solved-cant-figure-this-out-warning-mysql_num_rows-supplied-argument-is-not-a-va/#findComment-381746 Share on other sites More sharing options...
~n[EO]n~ Posted October 31, 2007 Author Share Posted October 31, 2007 Got this Your have an error because: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@hotmail.com' at line 1 I want to fetch the password from the db, i entered myname@hotmail.com in form field, why is it showing error near @ Quote Link to comment https://forums.phpfreaks.com/topic/75464-solved-cant-figure-this-out-warning-mysql_num_rows-supplied-argument-is-not-a-va/#findComment-381748 Share on other sites More sharing options...
khalidorama Posted October 31, 2007 Share Posted October 31, 2007 hi, Change your select statement to this code. It seems that there is a mistake in your current select statement. $sSql="Select mem_password from '.MEMBER_TABLE.' where mem_email = \"$_REQUEST['mem_email']\";"; Quote Link to comment https://forums.phpfreaks.com/topic/75464-solved-cant-figure-this-out-warning-mysql_num_rows-supplied-argument-is-not-a-va/#findComment-381755 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.