php基础:while循环查出所有数据库表行

$conn = mysql_connect('localhost','root','root');
mysql_query('use ctx',$conn);
mysql_query('set names utf8',$conn);

$sql = "select * from girl";
$rs = mysql_query($sql);
 $date = array();
while($row = mysql_fetch_row($rs)){
    $date[] = $row;
}
print_r($date);
?>

posted @ 2016-11-13 12:34  出来混迟早要胖的  阅读(2153)  评论(0编辑  收藏  举报