Subject how connections are handled ?
Author Sudheer Palaparambil
Hi friends,

I am new to PHP, but have been using firebird for the last
3 years.

My question is regarding connection handling. How do you
people handle db connection in a web application ? I have a
small web application to search a table based on some params
entered by the user. When the user submit the from, this is
what I do

prepare SP
execute SP
fetch rows
free result

Is this is the correct way of handing connection? Do I
have to connect and disconnect each time when the user press
the submit button? Can I open a db connection for an entire
session? ie, connect to db when the user login and disconnect
when the user logout or when a timeout occurs?

Please shed some light on this queries ?


Sudheer Palaparambil