note 109791 added to pdostatement.bindparam
| From: | flannell | Date: | Tue, 21 Aug 2012 12:27:12 +0000 |
| Subject: | note 109791 added to pdostatement.bindparam | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-190155@lists.php.net to get a copy of this message | ||
Spent all day banging my head against a brick wall.
Tried to use INOUT or OUT and getting the return variable into PHP using Mysql v5.5.16 on XAMPP.
"MySQL doesn't supporting binding output parameters via its C API. You must use SQL level
variables:"
$stm = $db->prepare("CALL sp_mysp(:Name, :Email, @sp_result)");
$outputArray = $db->query("select @sp_result")->fetch(PDO::FETCH_ASSOC);
So the 'workaround' for Mysql and PDO is to use two SQL calls.
Hope this helps someone.
----
Server IP: 69.147.83.197
Probable Submitter: 86.22.121.159
----
Manual Page -- http://www.php.net/manual/en/pdostatement.bindparam.php
Edit -- https://master.php.net/note/edit/109791
Del: integrated -- https://master.php.net/note/delete/109791/integrated
Del: useless -- https://master.php.net/note/delete/109791/useless
Del: bad code -- https://master.php.net/note/delete/109791/bad+code
Del: spam -- https://master.php.net/note/delete/109791/spam
Del: non-english -- https://master.php.net/note/delete/109791/non-english
Del: in docs -- https://master.php.net/note/delete/109791/in+docs
Del: other reasons-- https://master.php.net/note/delete/109791
Reject -- https://master.php.net/note/reject/109791
Search -- https://master.php.net/manage/user-notes.php