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?
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...