note 111861 added to mysqli-stmt.bind-param
| From: | ealexs at gmail dot com | Date: | Fri, 05 Apr 2013 11:57:34 +0000 |
| Subject: | note 111861 added to mysqli-stmt.bind-param | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-194348@lists.php.net to get a copy of this message | ||
Solution for variable number of arguments in bind_param with values (integer, null, float, boolean)
<?php
$ref = new ReflectionClass('mysqli_stmt');
$method = $ref->getMethod("bind_param");
$bind_arguments = array();
$bind_arguments[] = "";
// possible code here
$uid = uniqid();
$$uid = "your value or null";
$bind_arguments[] = &$$uid;
$bind_arguments[0] .= "s"; // 's' is string
// repeat as many times as you like
$method->invokeArgs($your_mysqli_stmt, $bind_arguments);
?>
----
Server IP: 69.147.83.199
Probable Submitter: 89.121.181.181
----
Manual Page -- http://php.net/manual/en/mysqli-stmt.bind-param.php
Edit -- https://master.php.net/note/edit/111861
Del: integrated -- https://master.php.net/note/delete/111861/integrated
Del: useless -- https://master.php.net/note/delete/111861/useless
Del: bad code -- https://master.php.net/note/delete/111861/bad+code
Del: spam -- https://master.php.net/note/delete/111861/spam
Del: non-english -- https://master.php.net/note/delete/111861/non-english
Del: in docs -- https://master.php.net/note/delete/111861/in+docs
Del: other reasons-- https://master.php.net/note/delete/111861
Reject -- https://master.php.net/note/reject/111861
Search -- https://master.php.net/manage/user-notes.php