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

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -