PHP - Mysql query problem -
i trying see if logged in user verified. there error:
warning: mysql_fetch_array(): supplied argument not valid mysql result resource in /home/psmcouk/public_html/colemansystems/verify.php on line 332
here php code:
$user1 = $_session['usr']; $result = mysql_query("select * phpbb_members membername=$user1"); while($row = mysql_fetch_array($result)) //line 332 { $valid = $row['valid']; } if($valid == "1"){ echo "$user1, you're account verified."; }
i can not see wrong code.
thanks!
all answers above lame.
$user1 = mysql_real_escape_string($_session['usr']); $query = "select valid phpbb_members membername='$user1' , valid=1"; $result = mysql_query($query) or trigger_error(mysql_error()." in ".$query); $valid = mysql_num_rows($result); if($valid){ echo "$user1, account verified."; }
Comments
Post a Comment