mysql -u USERNAME -p
mysql -u root -p databasename
$result = mysql_query("SELECT COUNT(*)
FROM `users_tbl`
WHERE `userName` = '$name' AND `password` = '$pass'");
if (!$result || mysql_num_rows($result) <= 0) {
// NO user found!
} else {
// User found and password matches
}