Home > Backend Development > PHP Tutorial > php怎么把mysql 的查询结果形成数字,有啥方便的办法

php怎么把mysql 的查询结果形成数字,有啥方便的办法

WBOY
Release: 2016-06-13 12:36:07
Original
869 people have browsed it

php如何把mysql 的查询结果形成数字,有啥方便的办法。
比如我sql=select id,title from table
里面有三条记录,
有什么办法让他的结果形成数组
========================================
标题1,标题2,标题3
=======================
$query = mysql_query($sql);
while($row = mysql_fetch_array($query))
{
echo "$row[title]";
}
用这样子的方式好像不太好

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