Code: Select all
$dbh = mysql_connect ("localhost", $user, $password);
mysql_select_db ($db);
if ($_POST['btnlogin']) {
$username = $_POST['username'];
$password = $_POST['password'];
$sqlusers = "SELECT * FROM users WHERE username = $username";
$result = mysql_query($sqlusers) or mysql_error(); //this doesnt ever seem to be a valid mysql resource.
if (!mysql_num_rows($result) or mysql_error()) { // this is line 20
echo 'There are no users registered.';
die();
}
$userinfo = mysql_fetch_assoc($result);
echo 'Thank you for logging in ' . $userinfo['username'];Anyone have a clue as to whats up?