Forum Moderators: coopster

Message Too Old, No Replies

error message

         

paul161

8:32 pm on Jun 18, 2005 (gmt 0)

10+ Year Member



When I run the script below I keep on getting this error message i
Parse error: parse error, unexpected '=' in /home/paul161/public_html/ateam.php on line 5 cant see why

<?php
@mysql_connect("localhost", "*****", "***") or die("Cannot connect to DB!");
@mysql_select_db("paul161_test") or die("Cannot select DB!");
$sql="SELECT email FROM users WHERE pasword=’".$pasword.”’
and password=’”.$password.”’”;

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.";
//proceed to perform website’s functionality – e.g. present information to the user
}

mcibor

9:03 pm on Jun 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Correct this line:

$sql="SELECT email FROM users WHERE pasword='$pasword' and password='$password'";
$r = mysql_query($sql) or die(mysql_error()); //no if needed. However if you finish debugging change the error to some king of message

if(!mysql_num_rows($r))...

I have no idea what was wrong in your code, as I see multiple question marks? instead of something relevant

Best regards
Michal Cibor

BTW. Why do you store redundant data? (Why double password?)