Hello,
I've got a MySQL database and am trying to retrieve one random record and display it on my website. (Each time the page loads I want a different record to appear.) I know how to list all records but not just one at random. Any help would be appreciated. Here's the select and display all records code:
<?php
$link = @mysql_connect(" ") or die('FAILED DATABASE CONNECTION');
mysql_select_db(" ");
$linkID = @mysql_connect(" ");
mysql_select_db(" , $linkID);
$resultID = mysql_query("SELECT DISTINCTROW tblMain.BusinessName,tblMain.Phone1
FROM tblMain WHERE tblMain.State='AZ' ");
while (list($BusinessName, $Phone1) = mysql_fetch_row($resultID))
{
echo
"$BusinessName<br>
$Phone1<br>
<br>";
}
mysql_close($linkID);
?>
Thanks in advance!