note 55197 deleted from function.pdostatement-execute by dbs

From: Date: Sun, 08 Jan 2006 14:01:20 +0000
Subject: note 55197 deleted from function.pdostatement-execute by dbs
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-101407@lists.php.net to get a copy of this message
Note Submitter: wb at pro-net dot co dot uk ---- When binding parameters you are not allowed to use them more then once in your query, therefore the following is invalid... <?php $statement = $pdo->prepare("SELECT * FROM table WHERE a > :value AND b < :value"); $statement->execute(array(':value' => 6)); ?> You should, instead, create a number of parameters and bind them separately... <?php $statement = $pdo->prepare("SELECT * FROM table WHERE a > :valueA AND b < :valueB"); $statement->execute(array(':valueA' => 6, 'valueB' => 6)); ?>

« previous php.notes (#101407) next »