t0m3kk Posted February 29, 2012 Share Posted February 29, 2012 Hi everyone, my module is in the final lap but I need to make a file which isn't included in admin panel or in hooks, the file must work with my ajax querys but I have a some troubles with this file. So my files is named: moderate.php To work with database I must include /classes/Db.php code: <?php require '../../classes/Db.php'; $db = Db::getInstance(); ?> The erros is: Fatal error: Class 'Db' not found in /home/gtsvetan/public_html/presta/modules/my_module_name/moderate.php on line 4 When I try with class name in the file Db.php - DbCore the following error is: Fatal error: Class 'MySQL' not found in /home/gtsvetan/public_html/presta/classes/Db.php on line 87 I include /classes/MySQL.php The code is: <?php require '../../classes/Db.php'; require '../../classes/MySQL.php'; $db = Db::getInstance(); ?> The erros is (with DbCore::getInstance() or Db::getInstance()): Fatal error: Class 'Db' not found in /home/gtsvetan/public_html/presta/classes/MySQL.php on line 28 So how to fix that or how to make a file which can working with database? Link to comment Share on other sites More sharing options...
t0m3kk Posted February 29, 2012 Author Share Posted February 29, 2012 So I examined the classes, controllers and config files. Class files are structored like this: filename = Db.php / classname = DbCore and etc with all class files. In folder /config the file named autoload.php is a simple function which include/require files in the system. So I'll investigate where is the point with this file... Link to comment Share on other sites More sharing options...
t0m3kk Posted February 29, 2012 Author Share Posted February 29, 2012 The solution is: Just include config.inc.php and enJoy When you are included this file everything will works 2 Link to comment Share on other sites More sharing options...
daquity36 Posted April 21, 2013 Share Posted April 21, 2013 Thank you so much! That drove me crazy! Link to comment Share on other sites More sharing options...
matto1 Posted May 17, 2014 Share Posted May 17, 2014 The solution is: Just include config.inc.php and enJoy When you are included this file everything will works Hi, Thank you for your generosity. It's so hard to find help and solution for our problems... Problems caused by a poor documentation. I love prestashop, but their support is very poor! I hope prestashop become greater than Magento. Thank you again. 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