1 (edited by Goober 2005-05-18 06:10)

Topic: Unable to fetch forum info

I seem to get an error message when I try to make replys to topics but not when I post a new topic. Here is the error message:

An error was encountered
File: /var/www/html/include/functions.php
Line: 252

PunBB reported: Unable to fetch forum info
Database reported: You have an error in your SQL syntax near '' at line 1 (Errno: 1064)

Here is line 252:

$result = $db->query('SELECT moderators, admmod_only, closed FROM '.$db->prefix.'forums WHERE id='.$forum_id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());

I also ran dump() and here is what I got when I tried to post using the quick post:

SELECT moderators, admmod_only, closed FROM pun_forums WHERE id=

Here is what i got using post.php:

SELECT moderators, admmod_only, closed FROM pun_forums WHERE id=6

PS: I've using version 1.1.5
Any ideas what is wrong? Thanks,
~Goober

Re: Unable to fetch forum info

Any mods installed? If so, try it with a fresh copy of the script that fails.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Unable to fetch forum info

Lol, nevermind, I figured out the problem...

The variables on line 70 in post.php are listed from the query on line 58. They were already listed on line 62. The listing is incomplete since there are more values fetched in the query then there are listed so both vars were empty. The function on line 75 sends the empty var $forum_id to the function, but since its empty it can't complete the query on line 252 in functions.php.

It was just a matter of effort on my part. wink But thanks for taking interest in my post... tongue
~Goober