数组输出问题

WBOY
Release: 2016-06-23 13:33:11
Original
918 people have browsed it


数据结构如上
用select  * from table limit 1
while($row=mysql_fetch_array($resutl)){
foreach($row as $key=>$val){

echo "$key => $val 
";

}


}


输出结构与表不一样,因为数据结构列的数量和字段名不固定,不能指定下标,请问下各位要怎么输出才可以达到跟表格式一致,谢谢了!!


回复讨论(解决方案)

mysql_fetch_array 改为 mysql_fetch_assoc

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template