Forum Moderators: coopster

Message Too Old, No Replies

Advice about MYSQL connection

         

orion_rus

4:53 pm on Feb 24, 2005 (gmt 0)

10+ Year Member



hello world i have severl php including in a main php
each php makes some functions.
But first and second are database and session php which start a session for user. Then i initialize database php, i open connection in it closing only then all inputs is done automatically. Am i right? or it better to start connection and stop it in each php?
Thanks for help

jatar_k

6:41 pm on Feb 24, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I open a connection in an included file at the beginning of each script.

I then pass that connection to any functions that need it.

I leave this connection open through the whoel script.

The proper way to do it would be to close it at the end of processing but often I don't even worry about it since, as you said, they are all closed at the end of script execution.

orion_rus

7:25 pm on Feb 24, 2005 (gmt 0)

10+ Year Member



In the other words i make all correct)

jatar_k

7:26 pm on Feb 24, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



yes ;)