Quote:
Originally Posted by TigerC10
PHP Code:
$passes = $db->query_read("SELECT password FROM ". TABLE_PREFIX ."user"); while( $user = $db->fetch_array($passes) ) { if( md5( $user[password] . $license ) == $_COOKIE['bbpassword'] ) { //Do something that you want to do when the password matches break; } }
This is terribly inefficient, I wouldn't do it if I were you.
|
You're right. But you can do the same thing in a single query. I forgot to mention that i will also be doing a lookup on the user ID:
PHP Code:
$stmt = "SELECT user.`userid`
FROM `user`
WHERE MD5(CONCAT(user.`password`, '" . $license . "')) = '" . $_COOKIE['bbpassword'] . "'
AND user.`userid` = '" . $userid . "'";
But thanks for the info, you've answered my question.