Home > Backend Development > PHP Tutorial > 怎么才能把查询出来的结果以数组的形式输出.

怎么才能把查询出来的结果以数组的形式输出.

WBOY
Release: 2016-06-13 12:46:40
Original
1105 people have browsed it

如何才能把查询出来的结果以数组的形式输出....
以下是我想要达到的结果...

$graph->xaxis->SetTickLabels(array('润安大厦','百花大厦','金梦大厦','恒丰大厦','华谊大厦','蓝鲸大厦','GG','DD','FF','HH','KK','FF','RR','TT',));
Copy after login


我希望用
$query_1 = "select * from tbl_area";<br />
	$sql_1 = mysql_query($query_1);<br />
	$row_1 = mysql_fetch_array($sql_1);
Copy after login

这样的方式把查询出来的结果按照上面'润安大厦','百花大厦','金梦大厦','恒丰大厦','华谊大厦','蓝鲸大厦','GG','DD','FF','HH','KK','FF','RR','TT',这样的方式打印出来要怎么才能做到,我试过用
while (	$row = mysql_fetch_array($sql)){echo "'".$row[areaname]."'".",";}
Copy after login
循环出来,可结果是套在里面的时候报错....

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