Home  >  Article  >  Backend Development  >  关于foreach输出有关问题

关于foreach输出有关问题

WBOY
WBOYOriginal
2016-06-13 12:39:42959browse

关于foreach输出问题
$sql1="select * from y_cate order by asc";
$result1=mysql_fetch_array(mysql_query($sql1));
var_dump($result1);
foreach($result1 as $ke=>$a){
    echo $a."
";
}
?>
我想用foreach 来循环输出cate表的所有数据,为什么只输出一条数据的?求解答

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn