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

mysql_fetch_array()有关问题

WBOY
WBOYOriginal
2016-06-13 12:45:08887browse

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)函数有没有,把数据结果放到数组中,通过数组的下表来操作数据集。请大神指教。

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