View Full Version : SQL error
wdavis111
05-13-2005, 01:01 PM
I just installed your forum-news on my new PHPNuke 7.7 (which uses PHPBB 2.14)test site, and I get the following error:
MYSQL ERROR: 1054 : Unknown column 'topic_id' in 'field list' QUERY: SELECT topic_id, forum_id, topic_title, topic_poster, topic_time, topic_views, topic_replies, topic_first_post_id FROM nuke_topics WHERE forum_id='1' ORDER BY topic_id DESC LIMIT 24
I looked inside nuke_topics and indeed the fields don't have these names, but rather only topicid, topicname, topicimage, and counter.
Any ideas? :(
Patrick
05-13-2005, 05:08 PM
That is interesting. I wonder if phpBB changed their database structure.
I will have to look into it. For now, you can modified this stuff yourself:
Open forum-news/classes/forums/phpBB_2.php and modify a couple of things:
Modify the names of the tables in the following to the names that you did see:
(around line 89)
$this->DB->query("SELECT tid, title, posts, starter_id, start_date, starter_name, views, forum_id FROM " . $this->DB->prefix . "topics WHERE ". $WHERE ." ORDER BY tid DESC LIMIT " . $number_to_fetch);
(around line 113)
$this->DB->query("SELECT post FROM " . $this->DB->prefix . "posts WHERE topic_id='" .$current_post['tid']. "' ORDER BY pid ASC LIMIT 1");
(around line 132)... modify the names in between ['...']
$this->POSTS[$post_count] = array(
"text" => $post_text,
"title" => $current_post['title'],
"author_name" => $current_post['starter_name'],
"author_id" => $current_post['starter_id'],
"date" => $current_post['start_date'],
"reply_num" => $current_post['posts'],
"view_num" => $current_post['views'],
"post_id" => $current_post['tid'],
"cat_id" => $current_post['forum_id'],
"author_url" => $this->get_Author_Link($current_post['starter_id']),
"post_url" => $this->get_Thread_Link($current_post['tid'])
);
I know that sounds like quite a bit, but you can probably modify all that in about five minutes. I will also take a look and see if the new phpBB version has modified the default table names or if this is just a result of PHPNuke modifying the table names. Either way, I will make sure to release a new class covering the changes.
wdavis111
05-13-2005, 05:36 PM
Thanks for the speedy reply. I'm not sure however if I'm smart enough to understand how this fixes my problem. If I read your code correctly, you're looking for fields
topic_id, forum_id, topic_title, topic_poster, topic_time, topic_views, topic_replies, topic_first_post_id FROM nuke_topics
while the only fields in my nuke_topics are
topicid, topicname, topicimage, and counter
Still needy,
Walter Davis in Houston, TX
wdavis111
05-13-2005, 06:00 PM
OK, I figured it out. In PHPNuke 7.7 with it's built-in PHPBB 2.14, they have use prefix_bb for strictly PHPBB tables, but prefix_ for shared tables. So when I configured forum-news to use a nuke_bb prefix, it finds the correct topics table... but apparently they share a USERS table...
So to make a long story short, I had to replace your prefix_users with a hardcoded nuke_users in about 3 different places to make this work.
Thanks for your hard work!
Walter Davis of Houston, TX :o
Patrick
05-13-2005, 07:23 PM
Ah, ok. I am glad you got that sorted out then. I will consider making a nuke module for the next version.
Powered by vBulletin™ Version 4.0.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.