View Single Post
Old Jul 30th, 2005, 6:27 PM   #12
Intimidat0r
Hobbyist Programmer
 
Intimidat0r's Avatar
 
Join Date: May 2005
Location: Don't know, but the padded walls are a nice touch.
Posts: 126
Rep Power: 0 Intimidat0r is an unknown quantity at this point
Send a message via ICQ to Intimidat0r Send a message via AIM to Intimidat0r Send a message via MSN to Intimidat0r Send a message via Yahoo to Intimidat0r
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
__________________
Children in the dark cause accidents, and accidents in the dark cause children.

http://www.ronincoders.org
Intimidat0r is offline   Reply With Quote