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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 05:01:31 2024 UTC