I use closeConnection(); function in __desctruct(); section in my proxy-class for Zend_Db.
As Bill Karwin said, Zend_Db will close database connection automatically after destruction.
Alex.
----- Original Message -----From: Conrad TaylorSent: Friday, August 22, 2008 4:39 PMSubject: [fw-db] How to properly close database connection after query?Hi, what's the proper way to close a connection? BTW, I'm doing the following using ZF 1.5.3: BEGIN PHP Code: public static function nextEpisode( $id, $is_admin = true ) { $episode = new Episode(); if ( $is_admin ) { $where = $episode->getAdapter()->quoteInto( 'id > ?', $id ); } else { $where = array( 'is_activated = ?' => 1, 'id > ?' => $id ); } $orderBy = 'id ASC'; $nextEpisode = $episode->fetchRow( $where, $orderBy ); $database = Zend_Registry::get( 'database' ); $database->closeConnection(); return $nextEpisode; } END PHP Code: Thanks in advance, -Conrad
View this message in context: How to properly close database connection after query?
Sent from the Zend DB mailing list archive at Nabble.com.
没有评论:
发表评论