|
|
 |
Re: FN-FORUM: PHP / MySQL Closing connections
date posted 21st August 2003 16:47
On 21 Aug 2003 15:50:14 -0000, you wrote:
>
>Just checking a few things.
>
>In a php script when you connect to a database (mysql_connect) then run =
a=20
>few queries and the page exits, does it automatically close the =
connection=20
>to mysql or do you have to close it in the code? I know it may be bad=20
>practice not to close it but I was under the impression it closed =
itself.
I always issue a
mysql_close ($Connection);
and keep the connection open for as short a time as possible, being a
bit of a defensive programmer.
>
>The other problem is that when I run a CHECK_TABLE command on a table in=
=20
>the database I get e.g. '12 clients is using or hasn't closed the table=20
>properly'. The check table command seems to clear this warning and =
running=20
>it again says the table is ok, but after a few days it starts to build =
up=20
>again the longer I leave it the more clients haven't closed the table=20
>properly. Is this a normal occurrence or have I made an oversight =
somewhere?
Caused by not doing above??? Probably Not! From the docs...
If you get the following warning from CHECK TABLE or myisamchk:=20
# clients is using or hasn't closed the table properly
this means that this counter has come out of sync. This doesn't mean
that the table is corrupted, but means that you should at least do a
check on the table to verify that it's okay.=20
I don't think this happens on Mysql 4... but I may be wrong there.
>
>Thanks in advance,
>
>Bill
>
>
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>redmail.com - webmail with a difference!
>10Mb for just GBP 9.99 a year. Launch special 1Gb for GBP 99.99 a year
>IMAP, POP3, Spam Filtering and Anti Virus as standard.
>Visit http://www.redmail.com/?fl-signup to join.
>
>To advertise here: http://www.freelancers.net/advertising.html
>
> |
 |
|