DB/DB_DataObject and MySQL character sets
| From: | Denis Gerasimov | Date: | Tue, 14 Dec 2004 09:23:53 +0000 |
| Subject: | DB/DB_DataObject and MySQL character sets | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-16221@lists.php.net to get a copy of this message | ||
Hello,
I use DB/DB_DataObject (latest versions) + MySQL 4.1.7
Almost every query to db fails with this message:
[DB_Error: message="DB Error: unknown error" code=-1 mode=return
level=notice prefix="" info="SELECT * FROM news_news WHERE status =
'PUBLISHED' ORDER BY date DESC LIMIT 8 [nativecode=1267 ** Illegal mix of
collations (cp1251_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE)
for operation '=']"]
MySQL default character set is cp1251, table data is stored in cp1251
codepage too.
AFAIK that may be fixed using the following query:
SET CHARACTER SET cp1251
but it should be run immediately after establishing connection to MySQL
server.
Is there a way to set the codepage (charater set) in DB_DataObject or, at
least, run this query first of all (I don't mean writing this query every
time after DB_DO instantiation of course)?
Maybe sombody knows how to make cp1251 default _connection_ charset in
MySQL, if so, please drop me a note. I tried:
default-character-set=cp1251
in my.ini, but it didn't help me.
Best regards, Denis Gerasimov
Outsourcing Services Manager,
VEKOS, Ltd.
www.vekos.ru