Topic: I nearly allways get "could not fetch topic list"
How do I fix that?
My forum is located at http://www.codeshack.se/forum if you wanna look at it. You'll probalby get tha same error. I'm running version 1.0 RC 2 with Mysql.
Thanks
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 troubleshooting → I nearly allways get "could not fetch topic list"
How do I fix that?
My forum is located at http://www.codeshack.se/forum if you wanna look at it. You'll probalby get tha same error. I'm running version 1.0 RC 2 with Mysql.
Thanks
why not run version 1.0.1
I have modded it pretty much, so it would be good if i could use the same version as I use now.
uhm, just mod version 1.0.1
Maybe. But If someone can help me to just make my version work, that would be much better.
no it wouldn't, because release candidates have errors....
Hmm. okay.. Then I'm afraid I have to upgrade anyway..
this could be a problem with rc2 itself, other than thatb i cant think of anything.
Enable DEBUG. Try it again and paste the error message here.
It says:
An error was encountered
File: /home/httpd/ws2464/codeshack.se/forum/viewforum.php
Line: 144
PunBB reported: Unable to fetch topic list for forum
Database reported: You have an error in your SQL syntax near 'WHERE t.id IN(0,6,14) ORDER BY sticky DESC, last_post DESC' at line 1 (Errno: 1064)
On that line I have
$result = $db->query('SELECT DISTINCT p.poster_id AS hasposted, t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM
'.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p'.$useindex.' ON t.id=p.topic_id AND p.poster_id='.$cur_user['id'].' WHERE t.id IN('.$threadids.') ORDER BY sticky DESC, last_post DESC') or error('Unable to fetch topic list for forum', __FILE__, __LINE__, $db->error());
}
That's odd. Could you try adding the following just above that line:
exit('SELECT DISTINCT p.poster_id AS hasposted, t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p'.$useindex.' ON t.id=p.topic_id AND p.poster_id='.$cur_user['id'].' WHERE t.id IN('.$threadids.') ORDER BY sticky DESC, last_post DESC');
And then paste the results here.
If I paste that code just before, and then try to view the page I come to a page with this source:
<table class="pun_plain" cellspacing="1" cellpadding="4">
<tr>
<td style="width: 53%"><b><a href="index.php">Codeshack</a> / PHP</b></td>
<td class="pun_right" style="width: 28%"> </td>
<td class="pun_right" style="width: 19%; white-space: nowrap"><b><a href="post.php?fid=1">Skapa ny tråd</a></b></td>
</tr>
</table>
<table class="pun_main" cellspacing="1" cellpadding="4">
<tr class="pun_head">
<td class="pun_head" style="width: 24px"> </td>
<td class="pun_head" style="width: *; white-space: nowrap">Tråd</td>
<td class="pun_head" style="width: 14%; white-space: nowrap">Skapare</td>
<td class="pun_headcent" style="width: 7%; white-space: nowrap">Svar</td>
<td class="pun_headcent" style="width: 7%; white-space: nowrap">Visningar</td>
<td class="pun_head" style="width: 25%; white-space: nowrap">Senaste inlägget</td>
</tr>
SELECT DISTINCT p.poster_id AS hasposted, t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM pun_topics AS t LEFT JOIN pun_posts AS p ON t.id=p.topic_id AND p.poster_id=1 WHERE t.id IN(0,6,14) ORDER BY sticky DESC, last_post DESC
I think somethings really outta order here
It is supposed to do that. Don't worry :)
However, I can't see what's wrong with the query. It seems fine to me. Hmm.
Edit: I just checked out your forum and it appears to work fine. Have you solved the problem?
Codeshack forum works fine for me. I checked it out just after I saw the post and it was fine then too.
i NEARLY allways get that error. Thats the problem!
Do you thing that I have to upgrade?
No, it must be an issue with your database. Try running REPAIR TABLE on all the tables.
How do I do that? Is that a command?
It's a SQL command. Access your (my)SQL database, USE yourpundatabase; SHOW TABLES; REPAIR TABLE tablename; on all tables.
I have ran that command now, and I haven't got any error-message yet. I'll inform you if I get one.
I don't get any error on your forum...
I friend have noticed a relation with logging in from the script-archive or the article-system. When you log in from the forum or don't log in at all, everything works fine. But when you log in from the script-archive or the article-system, you get the error message.
Do you think of anything that could be wrong when you read this?
I didn't realize you had made your own "additions" to the forum, so I really can't say. My best guess is that $cur_user for some reason doesn't get defined when login in through the script archive.
I'll check that out. But now it time to "snutta kudde"
$cur_user['username'] is not set, so I suppose everything else that have to do with $cur_user isn't set either. How can I be sure that $cur_user sets? Can you give me the code for that? I can't find what part it is..
It's all in common.php.
PunBB Forums → PunBB 1.2 troubleshooting → I nearly allways get "could not fetch topic list"
Powered by PunBB, supported by Informer Technologies, Inc.