I have a DB in which one table has info about cities, I would like to query the table in order to choose ramdomly one of the cities and show the info.
Any hints?
Merry Christmas to everyone and peace one day!;)
Ramdom results?
Moderator: General Moderators
you could use RAND in the query but you need to have..uh..i forgot what version it was implaneted in, try it in ways:
if that doest work then get the data into a array and use [php_man]array_rand[/php_man]
.
Code: Select all
<?php
$query = query("select city from tablename ORDER BY rand() LIMIT 5");
?>