function check_login_info($username, $password)
{
$user_exists = false;
$dbcon = db_connect();
$selected = mysql_select_db("users", $dbcon);
$userresult = mysql_query("SELECT username FROM users");
#################
while ($userrow = mysql_fetch_array($userresult, MYSQL_ASSOC))
{
if ($userrow['username'] == $username)
$user_exists = true;
}
if (!$user_exists)
{
die ("That user doesn't exist.");
}
$result = mysql_query("SELECT password FROM users WHERE username='".$username."'", $dbcon);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
if (md5($password) == md5($row['password']))
{
return login_user();
} else {
return false;
}
mysql_free_result($result);
mysql_close($dbcon);
}
im trying to do that and here's the warning im getting:
Quote:
|
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/infrec/public_html/infrec/login_result.php on line 17
|
line 17 is the one right under all the #s