Unable to jump to row 8 on MySQL result index 4
Posted: Wed Nov 05, 2003 9:02 am
Hello,
I am using PHP's rand function to randomyly select information fomr a mysql database
the following is my code
on running the code it works but sometimes i get the following error
what does that mean really?
Kendall
I am using PHP's rand function to randomyly select information fomr a mysql database
the following is my code
Code: Select all
$query = "SELECT * FROM banner_images WHERE type = 'B'";
$IMG = mysql_query($query, $Connection);
srand((double)microtime()*1000000);
$random_id = rand(0,mysql_num_rows($IMG));
// display chosen banner
// get random image
$file = mysql_result($IMG,$random_id,'file');
$id = mysql_result($IMG,$random_id,'ID');
$displays = mysql_result($IMG,$random_id,'displays') + 1;Code: Select all
Warning: mysql_result(): Unable to jump to row 8 on MySQL result index 4 on line 33Kendall