|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-12-15 01:17 UTC] 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. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 16 08:00:01 2025 UTC |
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);