fetchAll()与mysql_fetch_array()的区别详解
(编辑:jimmy 日期: 2024/11/19 浏览:3 次 )
同一个查询语句:
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"
}
下一篇:用mysql_fetch_array()获取当前行数据的方法详解