1 (edited by Peter 2007-03-16 21:13)

Topic: PunBB can't find posts anymore

I'm radically rearranging PunBB (sorry) to try to build a well-integrated site with several other php scripts.

So far everything sort of works, but now PunBB can't find the posts anymore.

...
According to debug the cause it's a syntax error:

An error was encountered
File: /home/website/public_html/forum/edit.php
Line: 28

PunBB reported: Unable to fetch post info

Database reported: 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 'ORDER BY posted LIMIT 1' at line 1 (Errno: 1064)

I added questions about that to this thread, but the line is unedited PunBB code and worked before.

So the problem may have nothing to do with php syntax and be something else I'm overlooking. I probably need to look at this from another perspective. That's why I post this as a seperate topic.

Apologies if it turns out to be a double post after all...

Re: PunBB can't find posts anymore

I don't believe the issue is related to the posts in the database: could you paste your lines 43 and 107 from viewtopic.php?

3

Re: PunBB can't find posts anymore

line 43:

    $_GET['p'] = ceil($i / $pun_user['disp_posts']);

line 107:

// Determine the post offset (based on $_GET['p'])
$num_pages = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);

But you would get this division by zero error if 0 posts are found, so I think it's more effect than cause. The cause seems to be the code can't get the posts and the posts are definately there in the database. I just need to figure out a way to get them to show up on the page.

Re: PunBB can't find posts anymore

But you would get this division by zero error if 0 posts are found, so I think it's more effect than cause. The cause seems to be the code can't get the posts and the posts are definately there in the database. I just need to figure out a way to get them to show up on the page.

No, you get it when $pun_user['disp_posts'] is set to 0. Which is not the number of posts that have been pulled from the database.

5

Re: PunBB can't find posts anymore

SOLVED