MySQL integer field is returned as string in PHP

前端 未结 15 2456
南旧
南旧 2020-11-22 16:17

I have a table field in a MySQL database:

userid INT(11)

So I am calling it to my page with this query:

\"SELECT userid FR         


        
15条回答
  •  盖世英雄少女心
    2020-11-22 16:57

    This happens when PDO::ATTR_EMULATE_PREPARES is set to true on the connection.

    Careful though, setting it to false disallows the use of parameters more than once. I believe it also affects the quality of the error messages coming back.

提交回复
热议问题