MyBB Community Forums

Full Version: 1146 - Table 'websitezr_bans.mybb_users' doesn't exist
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys,
I'm getting this odd error in one of my custom php pages. The error is this:

SQL Error:
    1146 - Table 'websitezr_bans.mybb_users' doesn't exist
Query:
    UPDATE mybb_users SET lastactive='1343592012', timeonline=timeonline+2 WHERE uid='1' 

Basically the custom php page that displays this is one that allows a user to search through another sql database (not the mybb sql database, but one that contains bans from one of our gaming servers). The php page connects to our ban database titled websitezr_bans. To get it to work with mybb I added:

define('IN_MYBB', 1); 
define('THIS_SCRIPT', 'server_bans.php');

require "./global.php";
As well as $headerinclude, $header, and the $footer. That's basically it. When I view the page as a guest it works perfectly. When I am logged in and view it, everything works except under the footer it displays that error message. I suppose mybb is trying to update my time online while viewing that page but is searching for it within my ban database and not the mybb database. Does anyone know if there is something i'm forgetting to add to the script to fix this issue, or if there is something I can do?

Thanks!
Can you post the whole script here? thanks.
Yep, you need to let us know the script fully because somehow you may be having wrong table prefix which is causing this error.
Yep!
Attached is the script i'm using.