Whether mysql connection will last until we close that page?
Hi, suppose if we are connecting to a database using mysql_connect ...
That connection will last until we go to the next page or close that page??????
And one more doubt is that after every transaction or commit the connection to the database will terminate?
The connection lasts till the end of the PHP code, it's closed with mysql_close, or, in the case of persistent connections until the connection is forced to close.
Thanks.. one more to ask
Please be specify that suppose we run a mysql_query and after that mysql_fetch_assoc.. I need to ask that after this execution whether our mysql connection will end up???
Erm, using the forums php code tags for normal text, that's intresting :P
As I said, the connection will stay open until the end of the page execution(where PHP does this automatically as a part of the clean up), you close it yourself( mysql_close() ).
It does not close just because you've run a query or read any results.
oh okkkkk im new to this forum.... anyways thanks
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread