Page 1 of 1

error message

Posted: Fri Feb 20, 2009 11:04 pm
by rwahdan
Hi all,

I have error message that i dont understand and dont know where to look for the error?

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 'where user_password='rami2009'' at line 1

I have found the problem. i had two where statements in the same row!

my problem now is that i dont get any error and i dont get anything printed on the screen and i dont know why! here is the code:

$host="xxx.com";
$db_name="xxx";
$username="xxx";
$password="xxx";
$theid=$_POST['loginid'];
$thepass=$_POST['password'];

mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");


$results= mysql_query("SELECT user_id, user_password FROM tbl_auth_user WHERE user_id='$theid' and user_password='$thepass'") or die(mysql_error());
$row = mysql_fetch_array($results);
$var1 = $row['user_id'];
$var2 = $row['user_password'];


echo $var1;
echo $var2;

Re: error message

Posted: Fri Feb 20, 2009 11:26 pm
by susrisha
do a print_r for the row

Code: Select all

 
print_r($row);
 

Re: error message

Posted: Fri Feb 20, 2009 11:29 pm
by susrisha
and please dont post the passwords and other sensitive information in the forum..
ps: I was able to login to your system.. Its quite insecure if it falls in wrong hands..