Jump to content


Photo

serious help!


  • Please log in to reply
1 reply to this topic

#1 onthespot

onthespot
  • Members
  • PipPipPip
  • Advanced Member
  • 424 posts

Posted 25 July 2006 - 11:01 PM

Please could you help me, the following is the code to login to my site:


$sql="SELECT loginid FROM userlogin WHERE loginid=’".$loginid.”’ and password=’”.$password.”’”; $r = mysql_query($sql); if(!$r) {

$err=mysql_error();

print $err;

exit(); } if(mysql_affected_rows()==0){

print "no such login in the system. please try again.";

exit(); } else{

print "successfully logged into system.";



i am getting an error of
Parse error: parse error, unexpected '=' in authenticate.php on line 5


i have not included the first 2 lines above this as they are just connecting and selecting the databse!
any ideas?

#2 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 25 July 2006 - 11:08 PM

You're using the wrong quote marks...use a single quote (') around the variables in your sql variable, not a back tic (`).  Also, you don't need to escape from the double quotes for your variables, however, it won't hurt anything if you do.

$sql = "SELECT loginid FROM userlogin WHERE loginid = '$loginid' and password = '$password'";





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users