Log in

View Full Version : Two querys.


Brad
03-07-2003, 07:33 PM
Ok, so i wrote these two querys for a april fools joke im playing, this is newer code and i cant test it tonight (not at home). So i was wondering if someone can check them for me. If they are correct etc. there is no room for error here.

The code:

$loo_666=$DB_site->query("SELECT user.userid FROM user ORDER BY rand() NOT IN(1,88,68,98,105,107,135) LIMIT 1");
$loo_222=$DB_site->query_first("SELECT password FROM user WHERE userid='$loo_666['userid']'");

Basicly what this sould do is:

Grab a random userid (frist query) that is not userid 1,88,68,98,105,107,135. Grab the password (hash) for the random userid (query two) that was found in query one.

Xenon
03-08-2003, 10:38 AM
use this:
$loo_666=$DB_site->query_first("SELECT user.userid FROM user where userid NOT IN(1,88,68,98,105,107,135) ORDER BY rand() LIMIT 1");
$loo_222=$DB_site->query_first("SELECT password FROM user WHERE userid='$loo_666[userid]'");

Dean C
03-08-2003, 10:57 AM
What is this meant to do Loo?

- miSt