note 75588 modified in function.mysqli-stmt-bind-result by tularis
| From: | tularis@php.net | Date: | Fri, 08 Jun 2007 12:57:32 +0000 |
| Subject: | note 75588 modified in function.mysqli-stmt-bind-result by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-127304@lists.php.net to get a copy of this message | ||
[[Editor's Note: Using array_unshift() would've been easier though]]
if you wanna call this function using like:
<?php
$add = call_user_func_array('mysqli_stmt_bind_result', $data);
?>
you'll need to add the the prepared statement links in the $data array;
the easiest wy to add a string on the beginning of an array I found was like the below, reversing
the array, adding the string and then reversing the array again to get a proper order...
array_unshift() only excepts arrays and typecasting didn't work for me. In my class this would
look like:
<?
$data = array_reverse($data);
$data[] = $this->prepared;
$data = array_reverse($data);
?>
Hope it's usefull to anyone...
--was--
if you wanna call this function using like:
<?php
$add = call_user_func_array('mysqli_stmt_bind_result', $data);
?>
you'll need to add the the prepared statement links in the $data array;
the easiest wy to add a string on the beginning of an array I found was like the below, reversing
the array, adding the string and then reversing the array again to get a proper order...
array_unshift() only excepts arrays and typecasting didn't work for me. In my class this would
look like:
<?
$data = array_reverse($data);
$data[] = $this->prepared;
$data = array_reverse($data);
?>
Hope it's usefull to anyone...
http://php.net/manual/en/function.mysqli-stmt-bind-result.php