Re: Random select -- Where am I going wrong?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here is my code.... I keep on getting a Resource id #2 ......whatever that
means....any help would be appreciated!



$music = mysql_query ("Select * from $db_table ORDER BY RAND() Limit 1");
if(!$music) die("Query Failed.");
while($row = mysql_fetch_row($music))
print "$music";
}

This is because you're printing $music--which is the resource ID--when you should be working with $row. Also, you're going to need to actually print $row[0] or $row['column'], not just $row.


Larry

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux