Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在PHP mySQL查询中,mySQL int返回为int而不是字符串_Php_Mysql_Types - Fatal编程技术网

在PHP mySQL查询中,mySQL int返回为int而不是字符串

在PHP mySQL查询中,mySQL int返回为int而不是字符串,php,mysql,types,Php,Mysql,Types,当我从表中提取数据时,字段的类型是int,当我使用PHP提取数据时,字段的类型保持为int。然而,在我的服务器上,它被作为字符串(正如我所期望的那样)拉入 两个数据库的字段类型均为int。这两台机器上的代码相同,但PHP版本略有不同。我不认为这是PHP变化的结果,因为这似乎是一种回归,而不是一种增强。我似乎不明白为什么会这样 本地PHP版本:5.3.13 远程PHP版本:5.3.3 你们知道发生了什么事吗?这很奇怪。您使用哪种API用php“拉”数据?php版本来自哪个发行库?查看是否helps

当我从表中提取数据时,字段的类型是
int
,当我使用PHP提取数据时,字段的类型保持为
int
。然而,在我的服务器上,它被作为
字符串
(正如我所期望的那样)拉入

两个数据库的字段类型均为
int
。这两台机器上的代码相同,但PHP版本略有不同。我不认为这是PHP变化的结果,因为这似乎是一种回归,而不是一种增强。我似乎不明白为什么会这样

本地PHP版本:5.3.13

远程PHP版本:5.3.3


你们知道发生了什么事吗?这很奇怪。

您使用哪种API用php“拉”数据?php版本来自哪个发行库?查看是否helps@kranthi117这确实有帮助,thanks@escitalopram使用PDO驱动程序