[SOLVED] Randomising the result form a DB query

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Calimero
Forum Contributor
Posts: 310
Joined: Thu Jan 22, 2004 6:54 pm
Location: Milky Way

[SOLVED] Randomising the result form a DB query

Post by Calimero »

The Problem:
I queried the DB and got back results, but I want them to appear in every new search (with the same keywords) differently (random ordering)
Is this done trough PHP or MySQL.

Thanks Ahead !
Last edited by Calimero on Wed Jun 09, 2004 1:34 am, edited 1 time in total.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

add ORDER BY RAND() to your query
User avatar
Calimero
Forum Contributor
Posts: 310
Joined: Thu Jan 22, 2004 6:54 pm
Location: Milky Way

THANK YOU !

Post by Calimero »

And something in the body :D
Post Reply