This post提供了四种检索MySQL查询结果的方法:
> mysqli_fetch_array
– 将结果行提取为关联行,数字数组或两者
$row = MysqLi_fetch_array($result); echo $row[0]; // or echo $row['online'];
> mysqli_fetch_assoc
– 将结果行作为关联数组获取
$row = MysqLi_fetch_assoc($result); echo $row['online'];
> mysqli_fetch_object
– 将结果集的当前行作为对象返回
$row = MysqLi_fetch_object($result); echo $row->online;
> mysqli_fetch_row
– 将结果行作为枚举数组
$row = MysqLi_fetch_row($result); echo $row[0];
Is there any significant difference between these four functions
没有.
他们可以互换使用吗?
是.