Home > Backend Development > PHP Tutorial > mysql_fetch_array()有关问题

mysql_fetch_array()有关问题

WBOY
Release: 2016-06-13 12:45:08
Original
883 people have browsed it

mysql_fetch_array()问题
while($row=mysql_fetch_array($result))
{
    echo $row[0];
}
为什么这样就能把查询的数据一条一条的输出,但是放到for循环里面不行,形如:
for($i=0;$i {
    echo $row[0];
}
这样就不能正确的输出数据了!

如果我想把从数据库中查询出来的数据放到for循环里面该怎么做,类似odbc_fetch_into($result,$row)函数有没有,把数据结果放到数组中,通过数组的下表来操作数据集。请大神指教。

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