mysql 查詢數(shù)據(jù)轉(zhuǎn)換,怎么樣將mysql中取出的數(shù)據(jù)轉(zhuǎn)換為數(shù)組存放?
$result = mysql_query("SELECT * FROM table");
$data = array();
while($rs = mysql_fetch_assoc($result)){
$data[] = $rs;
}
print_r($data);//$data就是數(shù)組了
$result = mysql_query("SELECT * FROM table");
$data = array();
while($rs = mysql_fetch_assoc($result)){
$data[] = $rs;
}
print_r($data);//$data就是數(shù)組了