2008年8月21日星期四

[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.

没有评论: