Jump to content

[SOLVED] Can't figure this out : Warning: mysql_num_rows(): supplied argument is not a va


Recommended Posts

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

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

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 @

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']\";";

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.