fetch_array
fetch_assoc()和fetch_array()区别
fetch_assoc()得到的是关联数组 例:array([username]=>'test',[password]=>'123456') fetch_array()得到的有关联数组也有索引数组,根据数据库中数据来决定。 例: array([username]=>'test',[password] ......
SQL中fetch_array()和fetch_row()的区别
相同点:两个的作用都是把查询结果的第一行返回到一个数组中。 不同点: fetch_row()是通过数字索引取值。 $res = mysqli_query($con,$sql);//返回资源 $arr = mysqli_fetch_row($res);//查询的第一行结果赋值给$arr print_r ......