

<?php
require_once ('connect.php');
$query = "SELECT ImageID FROM Images";
$result = @mysql_query ($query);
$num = mysql_num_rows ($result);
$id = rand(1,$num);
// So basically you see how many records there are in the database, then generate a random number between 1 and that many records
$query2 = "SELECT ImageID, Whatever, SomethingElse FROM Images WHERE ImageID='".$id."' ";
$result2 = @mysql_query ($query2);
?>


