summaryrefslogtreecommitdiff
path: root/ext/pgsql/pgsql.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-02-04 18:34:10 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-02-04 18:34:10 +0000
commit16f626702dc0d1e1bdab6a85d21c26b54c474c6d (patch)
tree95d633de9ccc21bff1bd0e5ffd9ee8cfc8558e70 /ext/pgsql/pgsql.c
parentbdfee70cec15d24b525735f6add33af2d25241b4 (diff)
downloadphp-git-16f626702dc0d1e1bdab6a85d21c26b54c474c6d.tar.gz
MFH
Diffstat (limited to 'ext/pgsql/pgsql.c')
-rw-r--r--ext/pgsql/pgsql.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index a8a24193d4..b72931119f 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -1437,23 +1437,18 @@ PHP_FUNCTION(pg_result_seek)
int row;
pgsql_result_handle *pg_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l",
- &result, &row) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result, &row) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result);
- /* Let see if we are better to have another function for this */
- /* if offset is omitted, return current position */
-/* if (ZEND_NUM_ARGS() == 1) */
-/* RETURN_LONG(pg_result->row); */
-
- if (row < 0 || row >= PQntuples(pg_result->result))
+ if (row < 0 || row >= PQntuples(pg_result->result)) {
RETURN_FALSE;
+ }
/* seek to offset */
- pg_result->row = row;
+ pg_result->row = row - 1;
RETURN_TRUE;
}
/* }}} */