thinkphp3.2.3 读取mysql int变成了string

修改框架源码就行了,(ThinkPHP/Library/Think/Db/Driver.class.php),大概在65行
 // PDO连接参数
    protected $options = array(
        PDO::ATTR_CASE              =>  PDO::CASE_LOWER,
        PDO::ATTR_ERRMODE           =>  PDO::ERRMODE_EXCEPTION,
        PDO::ATTR_ORACLE_NULLS      =>  PDO::NULL_NATURAL,
        PDO::ATTR_STRINGIFY_FETCHES =>  false,
        PDO::ATTR_EMULATE_PREPARES  =>   false,  //把这行加上去就可以了,是不是很简单
    );

你可能感兴趣的:(php)