Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Random mysql command?
Old 08-25-2004, 02:17 PM Random mysql command?
scottsgameroom's Avatar
Super Talker

Posts: 101
Trades: 0
Random command?

is there such thing so i can set it so that evry time the page loads up it loads a diferent image and text. Basically i need it to display a snippet from a review and the image to go with it.

is it possible?
scottsgameroom is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-25-2004, 02:21 PM
Unknown.

Posts: 1,693
Trades: 0
You can do it using order by rand() and limit the amount of results to 1

$sql = "SELECT * FROM tablename ORDER BY RAND() LIMIT 1";

-James
Dark-Skys99 is offline
Reply With Quote
View Public Profile
 
Old 08-25-2004, 02:22 PM
scottsgameroom's Avatar
Super Talker

Posts: 101
Trades: 0
sweet! i'll test it out!
scottsgameroom is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Random mysql command?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.44230 seconds with 12 queries