MyBB Community Forums

Full Version: MySQL Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

Whenever there is a mysql error in any page, it is displaying the actual query in that page. like

MySQL error: 1062
Duplicate entry 'bot=msnbot' for key 1
Query: INSERT INTO sessions (uid, sid, time, ip, location, useragent, location1, location2, nopermission) VALUES ('0', 'bot=msnbot', '1172341999', '207.46.98.70', '/forum/showthread.php?tid=70&pid=85', 'msnbot/1.0 (+http://search.msn.com/msnbot.htm)', '0', '70', '0')

I would like this page to be replaced with some generic error message say "An error occured. Please try again later ". something like that. Is there any way for doing this?

Thanks
This should not happen anyway.

Have you by any chance modified ./inc/class_session.php?

Please empty the sessions table in MyBB db through Phpmyadmin.
I did not make any changes ./inc/class_session.php. Emptying session table will solve the problem temporarily. Tomorrow it can come again and the actual query will be displayed on the browser. What we need is a custom generic error page which will be displayed whenever an unhandled exception occurs.
Did you change the sid column somehow?

This is the default:
sid varchar(32) NOT NULL default ''

There's no property in there that would be causing a duplicate entry error.

You shouldn't need a custom generic error page as long as we can get this fixed.
My sid column defintion looks same.
sid varchar(32) NOT NULL default '',