PDA

View Full Version : won't fetch userid


N!ck
03-11-2002, 12:07 AM
$usersql = $DB_site->query("SELECT userid FROM user WHERE username = '" . $utm[username] . "' AND password = '" . $utm[password] . "'");
$userinf = $DB_site->fetch_array($usersql);
$userid = $userinf['userid'];
if ($userid == "") {
echo "Your username/password did not match.";
exit;
}


this always produces an error that i have not entered the correct information even when i HAVE! does anyone see a problem with this php snippet?

Freddie Bingham
03-11-2002, 01:31 AM
$usersql = $DB_site->query_first("SELECT userid FROM user WHERE username = '" . addslashes(htmlspecialchars($utm[username])) . "' AND password = '" . addslashes(md5($utm[password])) . "'");

N!ck
03-11-2002, 01:33 AM
duh...the md5...

i am lame

N!ck
03-11-2002, 01:33 AM
thanks freddie