ID: 31096
Updated by: [EMAIL PROTECTED]
Reported By: glideraerobatics at hotmail dot com
Status: Bogus
Bug Type: Feature/Change Request
PHP Version: 5.0.2
New Comment:
last sample was incomplete:
$bindrow[0] = $stmt;
....
Previous Comments:
------------------------------------------------------------------------
[2004-12-15 07:46:47] [EMAIL PROTECTED]
We tried to keep mysqli simple and api conformant.
Binding an array to mysql_stmt_bind_param (or bind_result)
is pretty simple, so there is no need for providing a new
function - you can do this with 3 lines in userland code:
for ($i=0; $i < mysql_stmt_param_count($stmt); $i++)
$bindrow[] = &$row[$i];
call_user_func_array("mysqli_stmt_bind_result", $bindrow);
------------------------------------------------------------------------
[2004-12-15 01:17:33] glideraerobatics at hotmail dot com
Description:
------------
The function mysqli_stmt_bind_param() is a huge leap forward for PHP
but still has a terrible drawback:
I use DAO (not the Micro$oft kind) classes that create their own SQL
statements. These statements have varying numbers of fields and bind
markers (the ? marks).
If one could pass an array of values to mysqli_stmt_bind_param(), then
this problem could be solved, but it's not possible (yet).
Currently mysqli_stmt_bind_param() expects the programmer to just type
in a list of variable names as parameters. To make things worse, you
sometimes can't even use function calls as parameters because
mysqli_stmt_bind_param() complains about non-referenced variables (or
something).
Hopefully somebody bring PHP up to the level of other programming
languages in this area.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31096&edit=1