mysql - Doctrine 1.2 query with utf8 column name -
i have this same problem, doctrine 1.2 instead of doctrine 2.0.
i have column non-ascii character in name, , doctrine give me error when try select :
message: sqlstate[42000]: syntax error or access violation: 1064 have error in sql syntax; check manual corresponds mysql server version right syntax use near '??_avanc?? c4__1 (...)
where there should french "é" char instead of double questions marks.
here connection :
$conn = doctrine_manager::connection("mysql://username:password@locahost/mydb","my_connection"); $conn->setcollate('utf8_general_ci'); $conn->setcharset("utf8");
and here select :
$q = doctrine_query::create()->select("vicl_relevé_avancé vc")->from("vc.visiteclient")->where("vc.id = ?", $id)->execute();
thanks help
double question marks? ouch. implies multiple things going wrong.
the table/column needs character set utf8
; see show create table
check on that. fixing may fix problem, may make different.
select col, hex(col) tbl ...
-- see stored. latin1
show e9 é; utf8
show c3a9 é.
Comments
Post a Comment