Hi,
I'm having some problems with some code. Basically, it outputs 1 result and then gives this error:
The code is relatively simple:Code:Warning: Supplied argument is not a valid MySQL result resource in c:\phpdev\www\public\pcreview\new_list.php on line 13
Any Ideas what is causing the problem?PHP Code:<?php
$news = mysql_query("SELECT Name, AuthorID, Title, DateAdded, news.ID as nID, News FROM news, authors " .
"WHERE AuthorID=authors.ID ORDER BY DateAdded DESC");
if (!$news) {
print "Cannot query the database.<br>";
print mysql_error();
} else {
?>
<blockquote><ul>
<?php
while ($result = mysql_fetch_array($news)) {
$id = $result["nID"];
$authorid = $result["AuthorID"];
$news = $result["News"];
$title = $result["Title"];
$authorname = $result["Name"];
$date = $result["DateAdded"];
$title = stripslashes($title);
$news = stripslashes($news);
if($date != $olddate) {
echo "<LI><font face=\"Verdana, Tahoma\" size=\"2\">$date</font><br>\n";
}
$olddate = $date;
echo " - <font face=\"Verdana, Tahoma\" size=\"2\">$title by $authorname<br>$news<br>\n";
}
}
?>
</ul></blockquote>
Thanks
-Peter




)

Bookmarks