Jump to content

[SOLVED] Module seems to lose Db connection midway through operation


dhurley

Recommended Posts

Running Presta 1.5.6.1

 

The problem is under the configure section of a module. When you enter a response to the customers question it does not save to the database. This error is generated:

 

PHP Warning:  mysql_real_escape_string(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in mysite/modules/ask_question/ask_question.php on line 484, referer: http://www.mysite/backoffice/index.php?controller=AdminModules&token=db440915b2b491fc6b85e71a37154e8e&configure=ask_question&tab_module=front_office_features&module_name=ask_question&view_question=1
 
Troubleshooting advice on this error suggests that the database connection mysql_connect() has not been made. But the rest of the page/site runs fine. So it is being used everywhere else, and then dies when being called within a simple little function? 
 
I have tried this before the query that fails:
Db::getInstance()->disconnect();
Db::getInstance()->connect();
 
Also this problem is only on my production server, my development environment is fine.
 
Thanks for any help!!

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...