Problem with mysqli_bind_param
[email protected] (Diogo Neves)
| Newsgroups | php.general |
|---|---|
| Message-ID | <CAPq1HvvK8yENov4q-+ijDT7+yM3Nk2eNeOf=7sMdYeywV4j7ng@mail.gmail.com> |
I don't know if its a bug, a feature or just me being idiotic ( i don't
really discarded that yet )... but...
This is a small piece of my code.
if ( !empty( $types )) {
$tmp = Array( $types );
foreach( $array as $key => $value ) {
$tmp[] = &$array[ $key];
}
call_user_func_array( array( $stmt, 'bind_param' ), $tmp );
}
My problem was i get NULL on return of call_user_func_array... i tracked it
back to $stmt->bind_param( $types, $array[0], $array[1], $array[2] );
Then after all and some reading i found i was screwing up, yet, returning
null should be the right return?
I ask because it says nothing about NULL on
http://php.net/manual/en/mysqli-stmt.bind-param.php. Yet if i send
something that isn't a string in $types ( my screw up, anyway ) it don't
return false as i expected.
Thanks,
Diogo Neves