Jump to content

[SOLVED] mysql_fetch_array() error


forumnz

Recommended Posts

Heres my code which is supposed to select a random row from a db.

 

<?php
include('connectdb.php');

$result = mysql_query("SELECT * FROM fflists ORDER BY RAND () LIMIT 1");
while($row = mysql_fetch_array($result))
  {
  $business_name = $row['business_name'];
  echo $business_name;
  }
?>

 

And the error:

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /usr/local/www/vhosts/foodfinder.co.nz/httpdocs/rowtest.php on line 5

 

Thanks, Sam.

Link to comment
https://forums.phpfreaks.com/topic/87683-solved-mysql_fetch_array-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.