Home > Backend Development > PHP Tutorial > The int type of data queried by pdo and thinkphp is also String. Do other frameworks also treat it this way?

The int type of data queried by pdo and thinkphp is also String. Do other frameworks also treat it this way?

WBOY
Release: 2016-09-26 08:40:12
Original
1433 people have browsed it

The int type of data queried by pdo and thinkphp is also String. Do other frameworks also treat it this way?

Reply content:

The int type of data queried by pdo and thinkphp is also String. Do other frameworks also treat it this way?

I never noticed it before. It’s like this. I tested it with mysqli and the result was the same.
I checked online and found that many of them are like this, and it’s not just like this when querying with php.

If you use pdo,
pass one more parameter when instantiating:

<code>new PDO($dsn, $user, $pass, array(  
    PDO::ATTR_EMULATE_PREPARES => false  
))  
</code>
Copy after login

That’s it.

Reference:
http://blog.csdn.net/newjueqi...
https://segmentfault.com/q/10...

Related labels:
php
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template