Re: should each php-script clean up it's mysql connections
| From: | Becoming Digital | Date: | Thu, 03 Jul 2003 16:26:23 +0000 |
| Subject: | Re: should each php-script clean up it's mysql connections | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-29056@lists.php.net to get a copy of this message | ||
> Therefore I wonder: Is it a good behavior to end connections or let every
> php-script clean up after it self in some way?
Actually, it's much better practice to use the correct variable names. :P
"Cleaning up" won't help you if the script is incorrect, so the benefit of
unsetting variables is limited, at least with regards to error control. There
may be memory and/or storage benefits, but I am not aware of any that are
significant.
Edward Dudlik
Becoming Digital
www.becomingdigital.com
Did I help you? Want to show your thanks?
www.amazon.com/o/registry/EGDXEBBWTYUU
----- Original Message -----
From: "anders thoresson" <listor@thoresson.net>
To: <php-db@lists.php.net>
Sent: Wednesday, 02 July, 2003 12:30
Subject: [PHP-DB] should each php-script clean up it's mysql connections
Hi,
I just noticed something I haven't done before. I was writing this piece
of code:
$articlequery = "SELECT somestuff FROM sometable";
$result = mysql_query($query);
$row = mysql_fetch_row($result);
But I didn't get the result I expected. Finally, I noticed that my new
querystring was $articlequery and not $query. The query saved to $query was
apperently some old query used in another php-script within my site.
Therefore I wonder: Is it a good behavior to end connections or let every
php-script clean up after it self in some way?
--
anders thoresson
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php