Answer the question
In order to leave comments, you need to log in
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
Transferring the creation of a database connection to a separate file is, in principle, a convenient solution.
function with connections and in files where you need to connect to the database, call the function and that's it.
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 questionAsk a Question
731 491 924 answers to any question