#27212 [Opn->Csd]: Cannot bind array elements as parameters

From: Date: Wed, 11 Feb 2004 10:11:43 +0000
Subject: #27212 [Opn->Csd]: Cannot bind array elements as parameters
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-54740@lists.php.net to get a copy of this message
 ID:               27212
 Updated by:       sniper@php.net
 Reported By:      adam at trachtenberg dot com
-Status:           Open
+Status:           Closed
 Bug Type:         MySQL related
 Operating System: *
 PHP Version:      5CVS-2004-02-10 (dev)
 New Comment:

Georg changed the parameter to only accept strings.



Previous Comments:
------------------------------------------------------------------------

[2004-02-10 14:42:55] adam at trachtenberg dot com

Description:
------------
You cannot bind array elements as parameters in 
mysqli_bind_param(). This should either be fixed or 
documented. :)

Reproduce code:
---------------
$foo[0] = 'foo';

$link =  mysqli_connect("localhost", "root", "password",
"test");
$stmt = mysqli_prepare($link, 'INSERT INTO t VALUES (?)');
mysqli_bind_param($stmt, array(MYSQLI_BIND_STRING), $foo[0]);

mysqli_execute($stmt);

Expected result:
----------------
foo is inserted into table t

Actual result:
--------------
no data inserted


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=27212&edit=1


Thread (2 messages)

« previous php.bugs (#54740) next »