html - PHP & MySQL Search Column for value -
i little confused how $query works , how can find value... have 'checkuser.php' script. purpose here echo "correct" if user exists. have columns (username, password, email). want know how can search column 'username' value '$username'? have currently...
$query = sprintf("select * users concat(username) '$u'"); $result = mysql_query($query); if(mysql_num_rows($result) != 1) echo "username not found";
thanks!
this should work fine. didn't test though..
$query = "select * users username = '$u'"; $result = mysql_query($query); if(mysql_num_rows($result) > 0) echo "username not found";
Comments
Post a Comment