|
Ok I would suggest this is better done in code rather than in SQL. Simply because this would really need a SP which your version of MySql may not support.
run a query to get the IDs for the users
use a serverside code loop to get 10 rows at random and concatenate the IDs into a CSV string.
run an IN(csv) query to get those user records
while: (display loop)
show the user details, query the db for all images for that user and select one rownumber at random (>0 <rowcount), show the image.
close the images recordset
move to next user record.
wend:
close userRS
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|