NTLDR,
Got a question for you. I'm trying to modify the code a bit ... as you have seen... and one thing that's giving me trouble is queries that don't return anything. For example, I'm going to use the news script to display formatted articles with my left and right panels in place. So, I modified the script to send a threadid, then I limit the forum to the articles forum, and limit the returned posts to 1. The only problem is that if you type in he threadid incorrectly and it doesn't find it, I get a database error page. I'd like to throw up a template that says the article wasn't found. I've been fussing with the script and seem to be missing something because I can't get it to respond with anything but the error page....
I'm in this code....
PHP Code:
.....
if ($newsonoff!=0) {
$newsquery=$newsquery=$DB_site->query("SELECT thread.*,threadpost.pagetext AS pagetext
FROM thread LEFT JOIN post AS threadpost ON (thread.tpostid = threadpost.postid)
WHERE forumid IN ($newsforum)
AND thread.threadid = $articleid
ORDER BY thread.dateline DESC LIMIT $newsposts");
while ($news=$DB_site->fetch_array($newsquery)) {
$newsthreadid=$news[threadid];
$newstitle=$news[title];
$newstime=vbdate($timeformat,$news[dateline]);
$newsdate=vbdate($dateformat,$news[dateline]);
$newsusername=$news[postusername];
$newsuserid=$news[postuserid];
....
I'm assuming I need to do something with the while statement, but I haven't pinned it down.