note 113514 added to mysqli-stmt.bind-param
| From: | Boyet | Date: | Wed, 23 Oct 2013 12:56:50 +0000 |
| Subject: | note 113514 added to mysqli-stmt.bind-param | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-197304@lists.php.net to get a copy of this message | ||
I think this is a good way to automatically get the types for the binding in as few lines of code as
possible. If you bind the array values in the same order as when you used it for this you should not
worry about aligning them.
foreach($array as $var){
$chrType = substr((string)gettype($var),0,1);
$strType .= (!in_array($chrType,array("i","d","s"))) ? "b"
: $chrType;
}
----
Server IP: 69.147.83.199
Probable Submitter: 121.54.2.118
----
Manual Page -- http://php.net/manual/en/mysqli-stmt.bind-param.php
Edit -- https://master.php.net/note/edit/113514
Del: integrated -- https://master.php.net/note/delete/113514/integrated
Del: useless -- https://master.php.net/note/delete/113514/useless
Del: bad code -- https://master.php.net/note/delete/113514/bad+code
Del: spam -- https://master.php.net/note/delete/113514/spam
Del: non-english -- https://master.php.net/note/delete/113514/non-english
Del: in docs -- https://master.php.net/note/delete/113514/in+docs
Del: other reasons-- https://master.php.net/note/delete/113514
Reject -- https://master.php.net/note/reject/113514
Search -- https://master.php.net/manage/user-notes.php