Ikoshop Posted December 9, 2024 Share Posted December 9, 2024 (edited) I'm getting acquainted with reading and writing from the Prestashop database. I am trying to get an INSERT statement to work. $result should be true or false here, but instead it's a null value and nothing is written to the database. The command itself, if I run it from the phpmyadmin interface, works just fine. The docs mention using _DB_PREFIX_ but I'm not sure what the point of that is, and if I have to remove the 'ps_' just to re-add it with the prefix variable? EDIT: updated opening post as the site blocking the SQL quote made it too confusing. Edited December 9, 2024 by Ikoshop solved (see edit history) Link to comment Share on other sites More sharing options...
Prestashop Addict Posted December 9, 2024 Share Posted December 9, 2024 execute( instead of executeS( that's all. executeS is only for queries Link to comment Share on other sites More sharing options...
Ikoshop Posted December 9, 2024 Author Share Posted December 9, 2024 Thanks. I wonder why it's not either writing to the database or giving a result. Link to comment Share on other sites More sharing options...
Prestashop Addict Posted December 9, 2024 Share Posted December 9, 2024 Don't forget to change your title post by adding [SOLVED] and add a Thanks or Like to the good answer, this will help community. Link to comment Share on other sites More sharing options...
Ikoshop Posted December 9, 2024 Author Share Posted December 9, 2024 (edited) Nothing is solved. I realise the code I tried to share didn't post. updated opening post to try make it clearer Edited December 9, 2024 by Ikoshop (see edit history) Link to comment Share on other sites More sharing options...
Ikoshop Posted December 9, 2024 Author Share Posted December 9, 2024 For what it's worth, using the _DB_PREFIX_ makes absolutely no difference. Link to comment Share on other sites More sharing options...
Ikoshop Posted December 9, 2024 Author Share Posted December 9, 2024 OK, as it turns out, it is not possible to execute more than one command at a time, even separating them by ; This is different from ExecuteS, which allows multiple commands to be executed successively. 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