Quote:
Originally Posted by Andreas
If that is what you want
|
Yes that is part of what I want. This query would select 1 random user that has posted within the last 24 hours from the mysql table, but the only problem is that this needs to coincide with my sql from the first post which picks 1 random user from a different table in the database.
Is there a way to do this? Maybe having a query store all members that have posted within the last 24 hours in an array or something. Then another query pick 1 by random (according to calls from the query in my first post) from the array. Basically I need to combine these two sql queries together:
[sql]SELECT userid FROM " . TABLE_PREFIX . "user WHERE lastpost > UNIX_TIMESTAMP(NOW())-86400 ORDER BY RAND() LIMIT 1[/sql]
[sql]SELECT userid, title, ext, width, height FROM " . TABLE_PREFIX . "banners WHERE status = 'active' AND available >= 1 ORDER BY RAND() LIMIT 1[/sql]