onthespot Posted July 25, 2006 Share Posted July 25, 2006 Please could you help me, the following is the code to login to my site:[code]$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.";[/code]i am getting an error of [b]Parse error: parse error, unexpected '=' in authenticate.php on line 5[/b]i have not included the first 2 lines above this as they are just connecting and selecting the databse!any ideas? Link to comment https://forums.phpfreaks.com/topic/15630-serious-help/ Share on other sites More sharing options...
hitman6003 Posted July 25, 2006 Share Posted July 25, 2006 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.[code]$sql = "SELECT loginid FROM userlogin WHERE loginid = '$loginid' and password = '$password'";[/code] Link to comment https://forums.phpfreaks.com/topic/15630-serious-help/#findComment-63705 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.