老師的視頻首先講的非常好。$query=mysql_query('select?*?from?student');
while($row=mysql_fetch_row($query)){
????print_r($row);
}上面代碼是把本地數(shù)據(jù)庫的student表查詢到的數(shù)據(jù)以while的形式循環(huán)給打印出來但是我下面的代碼為什么只能得到第二條數(shù)據(jù)?求解,我現(xiàn)在還想不明白。。。。$query=mysql_query('select?*?from?student');
while(mysql_fetch_row($query)){
????print_r(mysql_fetch_row($query));
}
1 回答

hxh_kylin
TA貢獻33條經(jīng)驗 獲得超10個贊
mysql_fetch_row只讀取一行數(shù)據(jù),而在上面的循環(huán)中,第一次讀出了第一行數(shù)據(jù),而第二次時正好讀取并顯示了第二行數(shù)據(jù)
- 1 回答
- 0 關(guān)注
- 1552 瀏覽
添加回答
舉報
0/150
提交
取消