in reply to Getting MySQL Data into an Array.
This is a minor thing, but you may want to end up your mySQL stanza with a clean finish() in addition to the disconnect().
$sth->finish(); $dbh->disconnect();
It will work without the finish, but it's more explicit and it cuts down on pesky warning messages in /var/log/httpd/error_log like this:
DBI::db=HASH(0x82afc60)->disconnect invalidates 1 active statement handle (either destroy statement handles or call finish on them before disconnecting) at...As the warning message states, don't disconnect before finishing. Also, don't do either before you're done extracting your data from mySQL.
That's Spenser, with an "s" like the detective.
|
|---|