Two tables (Slightly 0T)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey,
My host has MySql 4.0.x so I cant really use the nested selects of 4.1 :-(
please tell me how you solved something like this;

I have two tables:
users_online (username , dateandtime)
users_details (cno, username, has_image, image_name)

1a) I have to select x records from users_online where $username is not more
than 3 minutes old,
1b) then I have to check if that username has_image,if yes, get the
imagename

I thought of having the imagename also in the users_details, but we are
allowing our members to
change/modify their images at will....

What kind of sql do I use above? I dont want to run a query on every record
returned from users_online
as that would be really "expensive".

Thanks,
Ryan



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.13 - Release Date: 4/16/2005

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux