hi,
i have a page tht displays hoteldetails from database..
i tke the data randomly..
so the page shuld randomly display the data..
hw do i use random function..?
my code is here..
so tht on refresh it shuld display randomly all records from database
<?php
echo'<form name="show">';
// require('opendb.php');
@mysql_select_db('Travel') or die("cannot select the database");
$hotelname=$POST['hotel'];
$city=$POST['city'];
//echo $city;
$rating=$POST['rating'];
$img=$POST['image'];
//echo $rating;
//echo '$city <br>';
//echo $hotelname;
$query="select * from hoteldetails order by(rand(hotel_cd))limit 5";
$rs = mysql_query($query) or die("query failed:".mysql_error());
$nums=mysql_num_rows($rs);
//echo $nums;
//echo'<center>There are ';
//echo "<b>".$nums."</b>";
//echo' Hotels that match your search criteria';
include("table2.html");
while($resource=mysql_fetch_array($rs))
{
// $resource['image'];
//$resource=mysql_fetch_array($rs)
echo"<tr class='linkstyle'>";
echo"<td width=60 align='center'><img src='links/".$resource['image']."'></td>";
echo"<td width=45 align='left' >".$resource['hotel_name']."</td>";
echo"<td width=120>".$resource['intro']."<br><right><a href=\"display_hotel1.php?id=".$resource['hotel_cd']. "\"><b> More Details</td>";
echo"</tr>";
}
echo'</form>';
?>
how do i get it..