#49880 [Opn->Bgs]: mysqli::prepare doesnt accept special chars in field names

From: Date: Wed, 14 Oct 2009 19:44:40 +0000
Subject: #49880 [Opn->Bgs]: mysqli::prepare doesnt accept special chars in field names
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-143574@lists.php.net to get a copy of this message
ID: 49880 Updated by: uw@php.net Reported By: thiago@php.net -Status: Open +Status: Bogus Bug Type: MySQLi related PHP Version: 5.2.11 New Comment: If MySQL does not support the syntax, PHP can't. Previous Comments: ------------------------------------------------------------------------ [2009-10-14 19:38:43] 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) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49880&edit=1

« previous php.bugs (#143574) next »