1 1. 编写php程序完成对用户表的显示 2 代码 3 string(1) "1" [1]=> string(2) "zs" [2]=> string(32) "e10adc3949ba59abbe56e057f20f883e" [3]=> string(11) "zs@sohu.com" [4]=> string(2) "30" }26 //mysql_fetch_assoc mysql_fetch_array27 while($row=mysql_fetch_row($res)){28 //第一种取法是 同 $row[$i]29 //echo " $row[0]--$row[1]--$row[2]";30 //echo "";31 //var_dump($row);32 //第二种取法33 foreach($row as $key => $val){34 echo "--$val";35 }36 echo ""; mysql_free_result($res); //释放内存 //mysql_close($conn);可写可不写 37 }