Home  >  Article  >  Backend Development  >  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
WBOYOriginal
2016-09-26 08:40:121410browse

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>

That’s it.

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

Statement:
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