#31096 [Opn->Bgs]: mysqli_stmt_bind_param drawbacks

From: Date: Wed, 15 Dec 2004 06:46:48 +0000
Subject: #31096 [Opn->Bgs]: mysqli_stmt_bind_param drawbacks
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-70264@lists.php.net to get a copy of this message
ID: 31096 Updated by: georg@php.net Reported By: glideraerobatics at hotmail dot com -Status: Open +Status: Bogus Bug Type: Feature/Change Request PHP Version: 5.0.2 New Comment: 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); Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#70264) next »