1146 - Table 'websitezr_bans.mybb_users' doesn't exist
mdb Offline
Junior Member
**
Posts: 27
Joined: May 2012
Post: #1
1146 - Table 'websitezr_bans.mybb_users' doesn't exist
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!

07-31-2012 01:58 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #2
RE: 1146 - Table 'websitezr_bans.mybb_users' doesn't exist
I can't reproduce the SQL error....

07-31-2012 02:58 AM
Find all posts by this user Quote this message in a reply
mdb Offline
Junior Member
**
Posts: 27
Joined: May 2012
Post: #3
RE: 1146 - Table 'websitezr_bans.mybb_users' doesn't exist
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...
07-31-2012 03:45 AM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #4
RE: 1146 - Table 'websitezr_bans.mybb_users' doesn't exist
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)?

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
07-31-2012 03:46 AM
Visit this user's website Find all posts by this user Quote this message in a reply
mdb Offline
Junior Member
**
Posts: 27
Joined: May 2012
Post: #5
RE: 1146 - Table 'websitezr_bans.mybb_users' doesn't exist
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!
07-31-2012 03:58 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #6
RE: 1146 - Table 'websitezr_bans.mybb_users' doesn't exist
I use a different database than my MyBB forum, but at the same "server".

07-31-2012 04:05 AM
Find all posts by this user Quote this message in a reply
mdb Offline
Junior Member
**
Posts: 27
Joined: May 2012
Post: #7
RE: 1146 - Table 'websitezr_bans.mybb_users' doesn't exist
RateU were you using localhost for the $sql_host variable ?

That seemed to be my problem
07-31-2012 04:25 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #8
RE: 1146 - Table 'websitezr_bans.mybb_users' doesn't exist
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.

07-31-2012 04:42 AM
Find all posts by this user Quote this message in a reply
mdb Offline
Junior Member
**
Posts: 27
Joined: May 2012
Post: #9
RE: 1146 - Table 'websitezr_bans.mybb_users' doesn't exist
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 ?
07-31-2012 04:46 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #10
RE: 1146 - Table 'websitezr_bans.mybb_users' doesn't exist
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.

07-31-2012 05:00 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: