M
M
Meridian3122013-12-08 17:28:29
PHP
Meridian312, 2013-12-08 17:28:29

What is the best way to connect to a database in php scripts?

Some files require database connections, is it worth making persistent connections or is it better to use mysql.php.ini as require_once?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vit, 2013-12-08
@Meridian312

Transferring the creation of a database connection to a separate file is, in principle, a convenient solution.

I
InDiGo2010, 2013-12-15
@InDiGo2010

function with connections and in files where you need to connect to the database, call the function and that's it.

A
Alexander Tokmakov, 2014-01-24
@calliko

I included! in the files you need. also works on all 100. it is not necessary to keep permanently open DB. You will use the framework in any way. this is inevitable for a php programmer. and oops will be too. evolution...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question