I'm having difficulty running the following 2 blocks of code on my server.
<?php
$sql = "SELECT * FROM newsItems";
mysql_connect();
$rs = mysql_db_query("a00yvrak",$sql);
?>
<?php
while ($row = mysql_fetch_object($rs))
{
$id = $row->id;
$title = $row->title;
printf("<a href=\"displayarticle.php?id=%s\">%s</a><br>",$id,$title);
}
?>
I get the following error "Warning: Supplied argument is not a valid MySQL result resource in /xxxxx/xxxxx/listnews.php on line 14" which is the start of my while loop. All database names are correct. Does anyone have an idea what I am missing? I know it is hard to say anything with limited info, but if I can get a push in the right direction it would be appreciated. The server is running PHP4 and MySQL 3.23.21-beta.
Thanks,
Chris