GriefCode Posted March 6, 2017 Posted March 6, 2017 Hey, I've got just a report on one of my recent plugins which resulted into an error, with the following info: SELECT tid FROM `ipb_forums_topics` AS `forums_topics` WHERE MONTH(FROM_UNIXTIME(start_date)) = MONTH(NOW()) AND tid IN (SELECT item_id FROM core_reputation_index WHERE app='forums' GROUP BY item_id ORDER BY COUNT(item_id) DESC) AND ( forum_id IN(X) ) LIMIT 5 IPS\Db\Exception: Table 'core_reputation_index' doesn't exist (1146) #0 /system/Db/Select.php(356): IPS\_Db->preparedQuery('SELECT tid FROM...', Array, true) #1 /system/Db/Select.php(418): IPS\Db\_Select->runQuery() I've no idea, as I have 2 test forums and my dev forum where this table is available, is there any condition that this table does not exists? Regards
Ryan Ashbrook Posted March 6, 2017 Posted March 6, 2017 The table name appears to be missing the database prefix. Notice how forums_topics has ipb_ on it, and core_reputation_index does not. You will need to adjust your code to add the prefix to the table name (\IPS\Db::i()->prefix).
Martin A. Posted March 6, 2017 Posted March 6, 2017 The table prefix, 'ipb_', is missing from the sub-query.
GriefCode Posted March 6, 2017 Author Posted March 6, 2017 1 minute ago, Ryan Ashbrook said: The table name appears to be missing the database prefix. Notice how forums_topics has ipb_ on it, and core_reputation_index does not. You will need to adjust your code to add the prefix to the table name (\IPS\Db::i()->prefix). Indeed, you are right. Thanks!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.