rosuandreimihai Posted April 3, 2016 Share Posted April 3, 2016 Hi all, How can I get the error result for the method Db::getInstance()->getRow()? The query used inside works perfect when tested on phpmyadmin but it does not give any result when used inside PS Could someone help me? Thank you! Link to comment Share on other sites More sharing options...
im_presto Posted April 3, 2016 Share Posted April 3, 2016 You can debug your query by print it and run in phpmyadmin directly. If it is working well then $results = Db :: getInstance()->ExecuteS($sql); If you need single row $row = current( $results ); May this will be helpful for you. Link to comment Share on other sites More sharing options...
rosuandreimihai Posted April 3, 2016 Author Share Posted April 3, 2016 I tested it in phpmyadmin and it works perfect. I also tried to use the executeS but still the same effect. Now I am looking for a way to see if PS shows any error when running the sql statement ... Link to comment Share on other sites More sharing options...
im_presto Posted April 3, 2016 Share Posted April 3, 2016 Have you turned on the debugging mode ?? Link to comment Share on other sites More sharing options...
shokinro Posted April 3, 2016 Share Posted April 3, 2016 In order to see error message page, as @im_presto pointed you need to turn on error displaying by setting _PS_MODE_DEV_ to true in following file /config/defines.inc.php define('_PS_MODE_DEV_', true); Link to comment Share on other sites More sharing options...
rosuandreimihai Posted April 3, 2016 Author Share Posted April 3, 2016 I did set the define('_PS_MODE_DEV_', true); but the problem is that the piece of code is on the module mailalerts and nothing shows up.. is there a log file with the errors or something like that? Link to comment Share on other sites More sharing options...
shokinro Posted April 3, 2016 Share Posted April 3, 2016 that is very strange, are you sure you connected to the same database? can you check the database connection info in file /config/settings.inc.php to see if it connects to the same database you are using phpmyadmin? Link to comment Share on other sites More sharing options...
rosuandreimihai Posted April 3, 2016 Author Share Posted April 3, 2016 (edited) Yes, it connects to the same database and it's very frustrating because no error is displayed.. That piece of code works perfect inside the PaymentModule but not inside the mailalerts.php... Edited April 4, 2016 by rosuandreimihai (see edit history) Link to comment Share on other sites More sharing options...
Alcino Posted July 12, 2021 Share Posted July 12, 2021 (edited) This might work: Db::getInstance()->getMsgError(); Edited July 12, 2021 by Alcino (see edit history) 1 Link to comment Share on other sites More sharing options...
luisleitaoaudio Posted July 6, 2022 Share Posted July 6, 2022 you should use Db::getInstance()->getRow($sql); 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