dhurley Posted January 17, 2014 Share Posted January 17, 2014 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 More sharing options...
Dh42 Posted January 17, 2014 Share Posted January 17, 2014 Are your mysql variables the same on each server? Link to comment Share on other sites More sharing options...
dhurley Posted January 17, 2014 Author Share Posted January 17, 2014 Do you mean MySql Server System Vars, or Db connection vars? Link to comment Share on other sites More sharing options...
dhurley Posted January 17, 2014 Author Share Posted January 17, 2014 Found it. The developer of this module was using mysql_real_escape_string() Changed that and it works now. Link to comment Share on other sites More sharing options...
vekia Posted January 19, 2014 Share Posted January 19, 2014 hello may i know what you use instead of this? or you just removed it? Link to comment Share on other sites More sharing options...
dhurley Posted January 20, 2014 Author Share Posted January 20, 2014 http://php.net/htmlentities Im sure there are input cleaners built into prestashop. But I like this one. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now