| You are here: DEVPPL ‹ Forum ‹ Programming ‹ PHP and MySQL Forum |
NOTIFICATIONS
|
|
|||||||||||||||
Login |
ORDER BY "random?" from MySQL
7 posts
• Page 1 of 1
0
ORDER BY "random?" from MySQL
When I list things from a MySQL database I can order by different things, but how can I do to just show random posts from the database?
- Ebba
- Reputation: 0
- Posts: 25
- Joined: Mon Aug 16, 2004 8:37 pm
- Highscores: 0
- Arcade winning challenges: 0
0
You are pretty close to the answer, you should use ORDER BY RAND()
[url=http://www.linkedin.com/profile/view?id=96243938]Meet me on LinkedIn[/url]
[img]http://www.devppl.com/images/facebook_icon_small.jpg[/img] Help DEVPPL grow, [url=http://www.facebook.com/pages/DEVPPL/140524279390050]like DEVPPL on facebook[/url]!
[img]http://www.devppl.com/images/facebook_icon_small.jpg[/img] Help DEVPPL grow, [url=http://www.facebook.com/pages/DEVPPL/140524279390050]like DEVPPL on facebook[/url]!
- Rasmus Lindström
- Site Admin
- Reputation: 18
- Posts: 2829
- Joined: Tue Aug 17, 2004 2:07 pm
- Location: Sweden
- Highscores: 1
- Arcade winning challenges: 0
0
Yes, its just how to order them. No duplicates with RAND()
[url=http://www.linkedin.com/profile/view?id=96243938]Meet me on LinkedIn[/url]
[img]http://www.devppl.com/images/facebook_icon_small.jpg[/img] Help DEVPPL grow, [url=http://www.facebook.com/pages/DEVPPL/140524279390050]like DEVPPL on facebook[/url]!
[img]http://www.devppl.com/images/facebook_icon_small.jpg[/img] Help DEVPPL grow, [url=http://www.facebook.com/pages/DEVPPL/140524279390050]like DEVPPL on facebook[/url]!
- Rasmus Lindström
- Site Admin
- Reputation: 18
- Posts: 2829
- Joined: Tue Aug 17, 2004 2:07 pm
- Location: Sweden
- Highscores: 1
- Arcade winning challenges: 0
|
|
