note 117596 added to pdo.prepare

From: Date: Fri, 03 Jul 2015 19:37:04 +0000
Subject: note 117596 added to pdo.prepare
Groups: php.notes 
Request: Send a blank email to php-notes+get-203037@lists.php.net to get a copy of this message
I am not sure if this is a bug or a feature, but if you define named parameters like :id, you can omit the colon on the associative array passed to execute() and the query will work as if the colon was there. For example: $db->prepare('SELECT * FROM users WHERE id=:id); $db->execute(array('id'=>1)); // work just fine ---- Server IP: 72.52.91.14 Probable Submitter: 177.148.230.5 ---- Manual Page -- http://php.net/manual/en/pdo.prepare.php Edit -- https://master.php.net/note/edit/117596 Del: integrated -- https://master.php.net/note/delete/117596/integrated Del: useless -- https://master.php.net/note/delete/117596/useless Del: bad code -- https://master.php.net/note/delete/117596/bad+code Del: spam -- https://master.php.net/note/delete/117596/spam Del: non-english -- https://master.php.net/note/delete/117596/non-english Del: in docs -- https://master.php.net/note/delete/117596/in+docs Del: other reasons-- https://master.php.net/note/delete/117596 Reject -- https://master.php.net/note/reject/117596 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#203037) next »