fetchAll()与mysql_fetch_array()的区别详解_php技巧
程序员文章站
2022-03-26 21:01:29
...
同一个查询语句:
fetchAll():
array(1) {
[0]=> array(6) {
["id"]=> string(2) "15"
[0]=> string(2) "15"
["lot_sellid"]=> string(20) "00000000000000003877"
[1]=> string(20) "00000000000000003877"
["lotteryid"]=> string(2) "D8"
[2]=> string(2) "D8"
}
}
mysql_fetch_array():
array(6) {
[0]=> string(2) "15"
["id"]=> string(2) "15"
[1]=> string(20) "00000000000000003877"
["lot_sellid"]=> string(20) "00000000000000003877"
[2]=> string(2) "D8"
["lotteryid"]=> string(2) "D8"
}
fetchAll():
复制代码 代码如下:
array(1) {
[0]=> array(6) {
["id"]=> string(2) "15"
[0]=> string(2) "15"
["lot_sellid"]=> string(20) "00000000000000003877"
[1]=> string(20) "00000000000000003877"
["lotteryid"]=> string(2) "D8"
[2]=> string(2) "D8"
}
}
mysql_fetch_array():
复制代码 代码如下:
array(6) {
[0]=> string(2) "15"
["id"]=> string(2) "15"
[1]=> string(20) "00000000000000003877"
["lot_sellid"]=> string(20) "00000000000000003877"
[2]=> string(2) "D8"
["lotteryid"]=> string(2) "D8"
}
下一篇: php工程师面试hr一般会问什么
推荐阅读
-
PHP中define() 与 const定义常量的区别详解
-
PHP抽象类与接口的区别实例详解
-
php 去除html标记--strip_tags与htmlspecialchars的区别详解
-
PHP flush()与ob_flush()的区别详解
-
fetchAll()与mysql_fetch_array()的区别详解
-
PHP中基于ts与nts版本- vc6和vc9编译版本的区别详解
-
深入mysql_fetch_row()与mysql_fetch_array()的区别详解
-
PHP中define() 与 const定义常量的区别详解
-
php中const与define的使用区别 详解
-
浅谈PHP与C#的值类型指向区别的详解