iliaa Tue Feb 4 13:34:11 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/pgsql pgsql.c Log: MFH Index: php4/ext/pgsql/pgsql.c diff -u php4/ext/pgsql/pgsql.c:1.244.2.6 php4/ext/pgsql/pgsql.c:1.244.2.7 --- php4/ext/pgsql/pgsql.c:1.244.2.6 Sat Jan 4 07:34:27 2003 +++ php4/ext/pgsql/pgsql.c Tue Feb 4 13:34:10 2003 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pgsql.c,v 1.244.2.6 2003/01/04 12:34:27 derick Exp $ */ +/* $Id: pgsql.c,v 1.244.2.7 2003/02/04 18:34:10 iliaa Exp $ */ #include <stdlib.h> @@ -1437,23 +1437,18 @@ 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; } /* }}} */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php