Answer the question
In order to leave comments, you need to log in
How to close db connections in time in PHP?
Good day to all.
Tell me how to close and open a database connection in time using PHP.
Let's make sure that there is no influx of information that the connection opening/closing functions will be mysql_connect( ) / mysql_close( ).
Unfortunately, I'm new to PHP, so I get this taftology:
function ( ){
mysql_connect ( ... );
// тело функции, например какой то запрос ...
mysql_close( ... );
}
Answer the question
In order to leave comments, you need to log in
if in a simple way - at the beginning of the script they opened it, at the end of the script they closed it.
Create your own view function
function doQuery () {
mysql_connect ( ... );
mysql_query ( ... );
mysql_close( ... );
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question