If you request a row that does not exist, it just fails, rather than simply returning false.
![]() | pg_fetch_assoc说明array pg_fetch_assoc ( resource result [, int row] )pg_fetch_assoc() 和调用 pg_fetch_array() 加上第三个可选参数 PGSQL_ASSOC 是等价的。它只返回一个关联数组。如果需要数字索引,用 pg_fetch_row()。 pg_fetch_assoc() 是 pg_fetch_row() 的扩展版本。除了将数据存储在数字索引(字段编号)之外,默认还将数组存储在关联索引(字段名)中。 row 是要被提取的行(记录)编号。第一行为 0。 pg_fetch_assoc() 并不明显比 pg_fetch_row() 慢,而且还显著更便于使用。
参见 pg_fetch_row(),pg_fetch_array(),pg_fetch_object() 和 pg_fetch_result()。 ![]()
25-May-2006 03:59
If you request a row that does not exist, it just fails, rather than simply returning false.
Luke
22-Sep-2005 09:34
Note:
petrus at bmail dot com dot au
25-Feb-2005 11:22
$dbconn3 = pg_connect("host=127.0.0.1 port=5432 dbname=blah user=blah password=blah");
spam at pasher dot org
25-Oct-2003 09:35
An important thing to note (as of PHP 4.3.2):
ninja (whorl) thinkninja (stop) com
21-Jun-2003 11:29
If you are moving between different versions of PHP, this might be handy:
Brenton Strickler
07-Jan-2003 09:53
At a glance, the syntax listed at the top of this page doesn't match the example. The PGSQL_ASSOC flag isn't necessary.
| ![]() |