note 93469 added to pdo.prepare

From: Date: Fri, 11 Sep 2009 11:44:31 +0000
Subject: note 93469 added to pdo.prepare
Groups: php.notes 
Request: Send a blank email to php-notes+get-160447@lists.php.net to get a copy of this message
beware PDO will emulate prepared statements/bound parameters for drivers that do not natively support them, and can also rewrite named or question mark style parameter markers to something more appropriate, if the driver supports one style but not the other. This includes mySQL it seems so try{ $sth1 = $this->db1->prepare($t1, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY)); } catch(PDOException $e){ return $this->pack('dbError', $e->getMessage()); } does not and so will not throw the exception if your SQL is wrong. You will need to check that $sth1 is not null. ---- Server IP: 92.48.74.199 Probable Submitter: 78.105.0.158 ---- Manual Page -- http://www.php.net/manual/en/pdo.prepare.php Edit -- https://master.php.net/note/edit/93469 Del: integrated -- https://master.php.net/note/delete/93469/integrated Del: useless -- https://master.php.net/note/delete/93469/useless Del: bad code -- https://master.php.net/note/delete/93469/bad+code Del: spam -- https://master.php.net/note/delete/93469/spam Del: non-english -- https://master.php.net/note/delete/93469/non-english Del: in docs -- https://master.php.net/note/delete/93469/in+docs Del: other reasons-- https://master.php.net/note/delete/93469 Reject -- https://master.php.net/note/reject/93469 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#160447) next »