Jump to content

What is the PHP variable or object to connect to database


ColdDistance
 Share

Recommended Posts

Hi, I'm trying to build a personal module to manage returns and I want to make a HTML select with the orders and their customers.

 

I need to know what is the variable or object to connect with the database because I do a SQL query in my PHP script, but I don't know how to do the connection to database.

Share this post


Link to post
Share on other sites

i forgot to mention about little modification for INSERT / UPDATE / DELETE queries:

 

in these cases you have to use execute function instead the executeS

 

example:

Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'something` (row) VALUES (value)');

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More