为什么只能查出一条数据,数据库有两个字段,id和name两个记录,1-tom 2-lisa,只能查出第一条
<?php $link = mysqli_connect('localhost', 'root', '','test') or die('数据库连接失败'); if($link){ echo"ok"; echo "\n"; }else{ echo"error"; } mysqli_select_db($link,'test'); mysqli_query($link,"set names 'utf8'"); $result = mysqli_query($link,'select * from user'); $row = mysqli_fetch_assoc($result); print_r($row);