請問老師,fechAll為什么要whiile語句呢>?好像省略也是可以的啊?
//得到結果集的所有記錄,(不知道為什么要WHILE語句)
function fetchAll($sql,$result_type=MYSQL_ASSOC){
$result=mysql_query($sql);
while(@$row=mysql_fetch_array($result,$result_type)){
$rows[]=$row;
}
return $rows;
}
//得到結果集的所有記錄,(不知道為什么要WHILE語句)
function fetchAll($sql,$result_type=MYSQL_ASSOC){
$result=mysql_query($sql);
while(@$row=mysql_fetch_array($result,$result_type)){
$rows[]=$row;
}
return $rows;
}
2015-04-03
舉報
2015-04-03
不while的話怎么輸出多條數據內。