note 117627 added to mysqli-stmt.bind-param

From: Date: Sat, 11 Jul 2015 21:14:56 +0000
Subject: note 117627 added to mysqli-stmt.bind-param
Groups: php.notes 
Request: Send a blank email to php-notes+get-203078@lists.php.net to get a copy of this message
When I tried to use nickv9's class BindParam, I had to make a small change to get it to work: <?php // snip... public function add( $type, &$value ){ $this->values[] = &$value; $this->types .= $type; } // snip... ?> Note the additional reference notation used within the function to add the parameter to the class variable (&$value instead of $value), not just in the parameter list. Otherwise, I got an error from call_user_func_array(): "Parameter 2 to mysqli_stmt::bind_param() expected to be a reference, value given..." ---- Server IP: 72.52.91.14 Probable Submitter: 80.219.239.210 ---- Manual Page -- http://php.net/manual/en/mysqli-stmt.bind-param.php Edit -- https://master.php.net/note/edit/117627 Del: integrated -- https://master.php.net/note/delete/117627/integrated Del: useless -- https://master.php.net/note/delete/117627/useless Del: bad code -- https://master.php.net/note/delete/117627/bad+code Del: spam -- https://master.php.net/note/delete/117627/spam Del: non-english -- https://master.php.net/note/delete/117627/non-english Del: in docs -- https://master.php.net/note/delete/117627/in+docs Del: other reasons-- https://master.php.net/note/delete/117627 Reject -- https://master.php.net/note/reject/117627 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#203078) next »