为什么这段代码不返回所有行?(why doesn't this code return all rows?)
我有一个访问数据库,其中一个表名为
Products
,其中包含9行。 我想要echo
所有的行,但是当我使用这段代码时,它只会echo
4行。 我的错在哪里?$conn = odbc_connect('MoeinODBCTest1', '', ''); $sql = "select * from Products"; $rs = odbc_exec($conn, $sql); while(odbc_fetch_row($rs)) { $arr = odbc_fetch_array($rs); print_r($arr); echo '<br>'; }
I have an access database, and one of the tables is called
Products
, which contains 9 rows. I want toecho
all of the rows, but when I use this code, it willecho
only 4 rows. Where is my fault ?$conn = odbc_connect('MoeinODBCTest1', '', ''); $sql = "select * from Products"; $rs = odbc_exec($conn, $sql); while(odbc_fetch_row($rs)) { $arr = odbc_fetch_array($rs); print_r($arr); echo '<br>'; }
原文:https://stackoverflow.com/questions/7367414
更新时间:2023-02-20 14:02