Hello,
I'm new to PHP/MYSQL and don't really know the proper way to search for a solution to my question.
When a user visits a page on my site, I want that page to randomly display table entires that have the number 1 in a specific column that I have setup in MySQL. Basically I have 100 stories in a database, I want 10 of them to be randomly displayed when someone visits the page. Let me know if I'm being to vague, like I mentioned I don't know how to even ask the question. oops:
Any link to a tutorial or the proper terminology so I can do a better search would be appreciated.
Thanks,
Gary
SOLVED - Need Help With Random Query Display
Moderator: General Moderators
SOLVED - Need Help With Random Query Display
Last edited by grozanc on Wed Nov 07, 2007 8:06 pm, edited 1 time in total.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Code: Select all
.. ORDER BY RAND() LIMIT 1SOLVED - Need Help With Random Query Display
Thanks everyone! I was able to figure out how to accomplish what I needed from you suggestions.