re-connection to mysql (suggesstion)

how is mysql api for php configured..

i want to open the database a couple of time in my long script(php file).

-whether i should open it once i keep it open through out the script

-or re-connect & then disconnect each time
sjehanzebAsked:
Who is Participating?
 
andrivConnect With a Mentor Commented:
I would Maintain the connection.
0
 
andrivCommented:
How long between connects, if it's a matter of a couple seconds leave open. If it's long periods of time then close.

Leaving it open reduces overhead but leaving open for a long period of time is a security concern.
0
 
sjehanzebAuthor Commented:
the file is about 700+ lines but not all of it is process caz they are function although it show about .3 to .4 sec avg loading time on my iis(winxp) AMD 450Mhz
0
 
lokeshvCommented:
no prblm in keeping connection open...

Lk
0
 
sjehanzebAuthor Commented:
i have given average answer so the any user can get the answer with cheap point
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.