|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-04-28 12:56 UTC] indeyets at gmail dot com
[2006-04-29 21:48 UTC] wez@php.net
[2007-12-19 09:57 UTC] indeyets at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 23:00:01 2025 UTC |
Description: ------------ notice: the same thing works just fine in mysql console! whenever I try to prepare some statement which uses utf-8 named tables (cyrillics in my case) I get mysql syntax-error Reproduce code: --------------- $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $pdo->exec("SET NAMES utf8"); try { $sth = $pdo->prepare("SELECT * FROM `test` WHERE `somecolumn` = :p1"); echo "query 1 is prepared fine\n"; $sth2 = $pdo->prepare("SELECT * FROM `тест` WHERE `somecolumn` = :p1"); echo "query 2 is prepared fine\n"; } catch (PDOException $e) { echo "failure: ".$e->getMessage()."\n"; } Expected result: ---------------- query 1 is prepared fine query 2 is prepared fine Actual result: -------------- query 1 is prepared fine failure: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':p1' at line 1