Jump to content

prestashop make database connection


Recommended Posts

I am currently learning Prestashop, so recently I have started module creation. Everything is fine with prestashop. But I have a doubt which came to my mind when I was recently developing a module. In the module file we don't need a manual connection to the database thats why we can use Db classes for all the database query which wraps the mysql_query function.
Now let's say I have one file that is in the module folder but not the module file some other external file and in that I want some database query. For that I really need the database connection as because it is an external file.
So here is my question.

1. How to make database connection in some external file (not the module file but the file inside the module folder).
2. How to use Db classes instead of mysql_query function in some external file ( not the module file but the file inside the module folder).

I have gone through all the documentation but did not got the answer. So hopefully I will get my answer from you all the developer. I am really curious to know the answer.

Edited by ajay_0162 (see edit history)
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...