note 111215 added to pdostatement.bindparam
| From: | MikeRobinson | Date: | Sat, 26 Jan 2013 23:56:41 +0000 |
| Subject: | note 111215 added to pdostatement.bindparam | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-193402@lists.php.net to get a copy of this message | ||
Note that with bindParam the second parameter is passed by reference. This means that the following
will produce a warning if E_STRICT is enabled:
<?php
$stmt->bindParam('type', $object->getType());
// Strict Standards: Only variables should be passed by reference in /path/to/file.php on line 123
?>
If the second parameter is not an actual variable, either set the result of $object->getType();
to a variable and use that variable in bindParam or use bindValue instead.
----
Server IP: 69.147.83.199
Probable Submitter: 186.15.14.108
----
Manual Page -- http://php.net/manual/en/pdostatement.bindparam.php
Edit -- https://master.php.net/note/edit/111215
Del: integrated -- https://master.php.net/note/delete/111215/integrated
Del: useless -- https://master.php.net/note/delete/111215/useless
Del: bad code -- https://master.php.net/note/delete/111215/bad+code
Del: spam -- https://master.php.net/note/delete/111215/spam
Del: non-english -- https://master.php.net/note/delete/111215/non-english
Del: in docs -- https://master.php.net/note/delete/111215/in+docs
Del: other reasons-- https://master.php.net/note/delete/111215
Reject -- https://master.php.net/note/reject/111215
Search -- https://master.php.net/manage/user-notes.php