我很好奇就while和foreach要選擇哪個才是對的呢?我相信官方出了選擇,應該是有用意?$storeList=$do->query("SELECT*FROM`store`");if(sizeof($storeList)!=0){foreach($storeListas$row){//do...}}$storeList=$do->query("SELECT*FROM`store`");if(mysqli_num_rows($storeList)!=0){while($row=mysqli_fetch_array($storeList)){//do...}}這兩個的差別會是在哪里?哪個效率好?且用途更多?
萌新!哪一個mysql select 查詢是好的?while and foreach求指導!
梵蒂岡之花
2019-08-17 10:59:42