we gaan naar www.php.net, tikken in mysql_close, en zien..."mysql_close() closes the connection to the MySQL server that's associated with the specified link identifier. If link_identifier isn't specified, the last opened link is used.
Using mysql_close() isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution. See also freeing resources.
Note: mysql_close() will not close persistent links created by mysql_pconnect().
"
en als commentaar:
"In spite of the documentation, it appears to be important to close the database. On my installation (RedHat 7.1, mysql 3.23, php 4.03pl1) when I didn't manually close the database after I finished with it I wound up with tons of open connections (exceeding my max allowed). Maybe this is because of lots of timing-out connections, but when I started closing the database after use, the problem went away."
Using mysql_close() isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution. See also freeing resources.
Note: mysql_close() will not close persistent links created by mysql_pconnect().
"
en als commentaar:
"In spite of the documentation, it appears to be important to close the database. On my installation (RedHat 7.1, mysql 3.23, php 4.03pl1) when I didn't manually close the database after I finished with it I wound up with tons of open connections (exceeding my max allowed). Maybe this is because of lots of timing-out connections, but when I started closing the database after use, the problem went away."
Ik zou zeggen alleen connectie niet sluiten als je in de kerk bent geboren. 
Het is netter om je eigen troep op te ruimen ipv ervan uit te gaan dat de engine het voor je oplost. bovendien zodra jij je connectie sluit is bij php4 die connectie meteen weer vrij om gebruikt te worden door een andere pagina (als je uiteraard persistant connecties gebruikt..)
Het is netter om je eigen troep op te ruimen ipv ervan uit te gaan dat de engine het voor je oplost. bovendien zodra jij je connectie sluit is bij php4 die connectie meteen weer vrij om gebruikt te worden door een andere pagina (als je uiteraard persistant connecties gebruikt..)
Back In Black!
"Je moet haar alleen aan de ketting leggen" - MueR
persistant connections gebruiken is niet aan te raden, het blijkt dat een normale connectie openen en sluiten sneller is.
Persistant connections gebruik je als een langzame verbinding hebt naar de DB.Op vrijdag 21 september 2001 10:34 schreef Zoijar het volgende:
persistant connections gebruiken is niet aan te raden, het blijkt dat een normale connectie openen en sluiten sneller is.
Normale connecties gebruik je in andere gevallen.
Programmer - an organism that turns coffee into software.
Dat geldt dan alleen voor mysql.Op vrijdag 21 september 2001 10:34 schreef Zoijar het volgende:
persistant connections gebruiken is niet aan te raden, het blijkt dat een normale connectie openen en sluiten sneller is.
Bij postgresql (en oracle en mssql etc) maakt het wel degelijk uit, omdat het opbouwen van de connectie een stuk langer duurt.
ja sorry, ik had het over MySQL idd.
okee, thanx
Het is dus inderdaad aan te raden omdat het netter programmeren is en omdat de server soms ook wel eens conncties openlaat.
Zoijar: Ik had natuurlijk wel in de php ref gekeken
Het is dus inderdaad aan te raden omdat het netter programmeren is en omdat de server soms ook wel eens conncties openlaat.
Zoijar: Ik had natuurlijk wel in de php ref gekeken
Pagina: 1