Home > Database > Mysql Tutorial > MySQL Treat Tiny As Boolean简析_MySQL

MySQL Treat Tiny As Boolean简析_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:41:04
Original
1670 people have browsed it

bitsCN.com
MySQL Treat Tiny As Boolean简析 使用MySqlClient访问tinyint unsign 字段返回布尔值 true 和 false,但是实际上该字段存储值为1-255分析:由于在Mysql中没有布尔类型值,MySqlClient在访问tinyint类型字段时默认作为布尔值使用。   解决:1.在连接串中增加 Treat Tiny As Boolean=false 配置.2.对应字段在SQL语句中*1,这样,读取出的字段值默认会被转换成int类型.  作者 bengda bitsCN.com

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Why does bool (false) appear?
From 1970-01-01 08:00:00
0
0
0
Why bool (false), what is bool?
From 1970-01-01 08:00:00
0
0
0
I got bool(false)
From 1970-01-01 08:00:00
0
0
0
I can’t figure out why the result is false 4.
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template