another question =( Resource id #14 error
Posted: Fri Feb 16, 2007 3:16 am
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Resource id #14' at line 1
Code: Select all
$conn=mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname) or die ('Could not connect: ' . mysql_error());
$query="SELECT * FROM t_banners ORDER BY RAND() LIMIT 1";
$qresult= mysql_query($query) or die(mysql_error());
$line = mysql_fetch_assoc(mysql_query($qresult)); // <--- error is here
echo $line['code'];