php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49880 mysqli::prepare doesnt accept special chars in field names
Submitted: 2009-10-14 19:38 UTC Modified: 2009-10-14 19:44 UTC
From: thiago@php.net Assigned:
Status: Not a bug Package: MySQLi related
PHP Version: 5.2.11 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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: thiago@php.net
New email:
PHP Version: OS:

 

 [2009-10-14 19:38 UTC] thiago@php.net
Description:
------------
This bug's PHP Version is set to 5.2.11 but that's not true. I cannot upgrade my version from 5.2.6 at the moment. Sorry about this.

I was trying to prepare a statement where a field name had a "-" and it was returning (boolean)FALSE. As soon as I updated my database field "e-mail" to "email", and changed my statement to match the field again, it worked like a charm.

Reproduce code:
---------------
<?php
$mysqli = new mysqli('localhost','root','pass');
$mysqli->select_db('test');

$query = "INSERT INTO
            dummy
            ( name, e-mail, title, text)
            VALUES (
              ?,    ?,    ?,        ?)";

var_dump($mysqli->prepare($query));
?>

Expected result:
----------------
object(mysqli_stmt)

Actual result:
--------------
false(boolean)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-14 19:44 UTC] uw@php.net
If MySQL does not support the syntax, PHP can't. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 05:01:29 2024 UTC