Re: pdo prepare()

From: Date: Mon, 03 Oct 2005 19:18:25 +0000
Subject: Re: pdo prepare()
References: 1 2 3 4  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-3039@lists.php.net to get a copy of this message
Wez Furlong wrote:
On 9/30/05, Lukas Smith <lsmith@php.net> wrote:
I tried on mysql (against a version 5 server) and pgsql (against a version 8 server). Both of them should use native prepared queries, or?
They should. How do you "measure" that they're not preparing until later?
Sorry was away playing fribee for 3 days. I measured it by preparing a query on a non existant table. try { $dbh = new PDO($dsn, $user, $password); } catch (PDOException $e) { echo 'Connection failed: ' . $e->getMessage(); } var_dump($dbh->errorCode()); var_dump($dbh->query('UPDATE lala SET foo=1')); var_dump($dbh->errorCode()); var_dump($stmt = $dbh->prepare('UPDATE lala SET foo=1')); var_dump($dbh->errorCode()); var_dump($stmt->execute()); var_dump($stmt->errorCode()); Running similar code already gave me an error after the prepare call regards, Lukas

« previous php.pecl.dev (#3039) next »