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

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

WBOY
WBOYOriginal
2016-06-13 12:36:07809browse

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

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