(PHP 4, PHP 5, PHP 7)
pg_fetch_row — 锟斤拷取一锟斤拷锟斤拷为枚锟斤拷锟斤拷锟斤拷
$result
[, int $row
] ) : array
pg_fetch_row() 锟斤拷锟斤拷指锟斤拷锟斤拷 result
锟斤拷源锟斤拷取一锟斤拷锟斤拷锟捷o拷锟斤拷录锟斤拷锟斤拷为锟斤拷锟介返锟截★拷每锟斤拷锟矫碉拷锟斤拷锟斤拷锟斤拷锟轿达拷锟斤拷锟斤拷锟斤拷锟斤拷校锟斤拷锟狡拷锟斤拷锟� 0 锟斤拷始锟斤拷
Note: 锟剿猴拷锟斤拷锟斤拷 NULL 锟街讹拷锟斤拷锟斤拷为 PHP
NULL
值锟斤拷
result
PostgreSQL query result resource, returned by pg_query(), pg_query_params() or pg_execute() (among others).
row
Row number in result to fetch. Rows are numbered from 0 upwards. If
omitted or NULL
, the next row is fetched.
An array, indexed from 0 upwards, with each value
represented as a string. Database NULL
values are returned as NULL
.
锟斤拷锟截碉拷锟斤拷锟斤拷锟斤拷锟饺★拷锟斤拷锟斤拷锟揭伙拷隆锟斤拷锟斤拷没锟叫革拷锟斤拷锟斤拷 row
锟斤拷锟斤拷取锟斤拷锟津返伙拷 FALSE
锟斤拷
锟芥本 | 说锟斤拷 |
---|---|
4.1.0 |
锟斤拷锟斤拷 row 锟斤拷为锟斤拷选锟斤拷锟斤拷锟斤拷
|
Example #1 pg_fetch_row() 锟斤拷锟斤拷
<?php
$conn = pg_pconnect("dbname=publisher");
if (!$conn) {
echo "An error occured.\n";
exit;
}
$result = pg_query($conn, "SELECT author, email FROM authors");
if (!$result) {
echo "An error occured.\n";
exit;
}
while ($row = pg_fetch_row($result)) {
echo "Author: $row[0] E-mail: $row[1]";
echo "<br />\n";
}
?>