MyBB Hacks

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.
Pages: 1 2
Hey guys,
So again, i'm working on a new custom php script that allows users to view a bans list from a database on our sql. The page works perfectly as far as I can tell, except for that error below keeps getting displayed below the footer. It only happens when I view the page while logged in, not as a guest.

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


The script is connecting to our websitezr_bans database where the bans are stored. The page works perfectly except that error being displayed below the footer whilst i'm logged in. I'm assuming it's trying to update my time spent online but for some reason is searching for it within the bans database instead of the mybb forums database. I'm hoping you guys could take a look at my script and possibly see what i'm doing wrong / how to fix it? Below is a link to the script i'm using.

http://pastebin.com/CxmsX3Wc

Thanks guys!

I can't reproduce the SQL error....
Really? Damn that's odd...

It only happens when i'm logged in, if viewing as a guest it works fine. Did you create a new database for the script to function? I'm not sure if that would have anything to do with it but...
I had a similar error yesterday, I was messing with my local server >_>

Does this really only happen in this new page of yours?

... Why don't you use of mybb code (to conect to the DB for example)?
Sama youre a genius! haha
I'm not a coder by any means, but when you said you were having the problem on your localhost, on a whim, for $sql_host instead of using localhost i tried using my websites url, and that got rid of the errors.

Does anyone know why that would effect it ?

Thanks!
I use a different database than my MyBB forum, but at the same "server".
RateU were you using localhost for the $sql_host variable ?

That seemed to be my problem
I use localhost because my "server" (in localhost) uses localhost as the host name.

Note that I didn't test it in a live server.
Bah, just noticed 2 other sort of errors. This happened with localhost as well. Sorry guys!

I have Ajam PM Notifications plugin installed, and on my normal mybb pages it shows in the top left of the header like this:
[Image: 29cugyg.jpg]

However in the server_bans.php script it shows like this:
[Image: svoyua.jpg]


As well I have my forums set to show the php and sql information at the bottom of my footer for admins. Like this:
[Image: 2a6730m.jpg]

But on the custom script it doesn't show it, instead its just blank like this:
[Image: 2gtno28.jpg]

Are you able to reproduce errors like that RateU ?
I don't have Ajam PM Notifications plugin.
You need to use output_page() function for outputting your page if you want to display the Advanced Stats / Debug information at your footer.
Pages: 1 2
Reference URL's