php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27212 Cannot bind array elements as parameters
Submitted: 2004-02-10 14:42 UTC Modified: 2004-02-11 05:11 UTC
From: adam at trachtenberg dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 5CVS-2004-02-10 (dev) OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: adam at trachtenberg dot com
New email:
PHP Version: OS:

 

 [2004-02-10 14:42 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-11 05:11 UTC] sniper@php.net
Georg changed the parameter to only accept strings.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jun 03 01:01:26 2025 UTC