Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19116 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89953 invoked by uid 1010); 22 Sep 2005 10:53:50 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 89938 invoked from network); 22 Sep 2005 10:53:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Sep 2005 10:53:50 -0000 X-Host-Fingerprint: 195.225.34.5 fw01.axit.nl Received: from ([195.225.34.5:29549] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 56/98-24510-D3D82334 for ; Thu, 22 Sep 2005 06:53:50 -0400 Message-ID: <56.98.24510.D3D82334@pb1.pair.com> To: internals@lists.php.net Date: Thu, 22 Sep 2005 12:53:46 +0200 Lines: 39 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Posted-By: 195.225.34.5 Subject: PDO questions From: r.korving@xit.nl ("Ron Korving") After reading the php|architect article on PDO by Ilia I have a couple of questions: 1) Does unsetting $stmt trigger a closeCursor() as well? I assume so, but the article doesn't mention it. It only talks about the importance of calling that method. 2) Could it be a good idea (performance wise) and possible in the first place to maintain a pool of prepared statements? Something like this: class MyClass { private $stmts = array(); public function __construct($db) { $this->db = $db; } public function getInfo() { if (!isset($this->stmts["info"])) $this->stmts["info"] = $this->db->prepare("select ........."); $this->stmts["info"]->execute(array("foo", "bar")); ... } } 3) Wouldn't it be nice if you could do a $stmt->execute("foo", "bar"); (numeric parameters) instead of $stmt->execute(array("foo", "bar")); ? Nice article by the way, Ilia, although I think the php|arch editor(s) really could do a better job. I wrote an article for them myself on SOAP a while ago, and I can't say I was too satisfied on the job the editor did on it. Ron