mysql_fetch_array(): supplied argument is not a valid MySQL result

This code on one site works:
PHP Code:
$db mysql_connect"localhost""$dbusername""$dbpassword") or die( "Unable to connect to server!");
mysql_select_db("$db_name",$db);

$blurb mysql_query("SELECT date,id,author,blurb FROM blurbs ORDER by id DESC limit 0,1",$db);

while (
$myrowb mysql_fetch_array($blurb)) {
    
//do looping code here 
But this below on another gives the problem "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site75/fst/var/www/html/test/index.php on line 15"
PHP Code:
$db mysql_connect"localhost""$dbusername""$dbpassword") or die( "Unable to connect to server!");
mysql_select_db("$db_name",$db) or die ("unable to connect");

$blurb mysql_query("SELECT date,id,title,update,author FROM updates ORDER by id DESC limit 0,10",$db);

while (
$myrowb mysql_fetch_array($blurb)) {
// looping code here 
I have checked the database paths are right, the table name is right, the variables all exist, there is a row in the database... I have no idea, do you?

 

 

 

 

Top