PHP读取MySQL位字段返回奇怪的字符 [英] php reading mysql bit field returning weird character
本文介绍了PHP读取MySQL位字段返回奇怪的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用mysql_fetch_assoc($query)
,其中一个位字段返回为,这应该是正确的.
问题是我还需要将其输出到xml,这是一个非法的xml字符.
db表的字符集为utf-8.为什么会这样?
I am using mysql_fetch_assoc($query)
, one of the bit field returns out to be , which is supposedly to be true.
The problem is that I also need to output this to xml and it's an illegal xml character.
the charset for the db table is utf-8. why does this happen?
推荐答案
在SELECT中使用BIN函数.
Use the BIN function in your SELECT.
http://dev.mysql.com /doc/refman/5.0/en/bit-field-literals.html
这篇关于PHP读取MySQL位字段返回奇怪的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文