Re: [PHP-CVS] cvs: php-src / NEWS /ext/pgsql pgsql.c php_pgsql.h
Done. Dunno if i have to put new files anywhere else other than just added them Surely it should be the function writer's job to document what they add? This function should probably also be called 'pg_fetch_column' to be consistent. Chris Antony Dovgal wrote: Send a patch to the docs list? On Fri, 08 Jul 2005 15:48:38 +0800 Christopher Kings-Lynne [EMAIL PROTECTED] wrote: Docs? Ilia Alshanetsky wrote: iliaa Thu Jul 7 20:40:33 2005 EDT Modified files: /php-src NEWS /php-src/ext/pgsql pgsql.c php_pgsql.h Log: Added pg_fetch_all_columns() function to fetch all values of a column from a result cursor. http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1987r2=1.1988ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1987 php-src/NEWS:1.1988 --- php-src/NEWS:1.1987 Thu Jul 7 12:07:08 2005 +++ php-src/NEWSThu Jul 7 20:40:32 2005 @@ -5,6 +5,8 @@ - Added PDO_MYSQL_ATTR_USE_BUFFERED_QUERY parameter for pdo_mysql. (Ilia) - Added date_timezone_set() function to set the timezone that the date functions will use. (Derick) +- Added pg_fetch_all_columns() function to fetch all values of a column from + a result cursor. (Ilia) - Implemented feature request #33452 (Year belonging to ISO week). (Derick) - Fixed support for shared extensions on AIX. (Dmitry) - Fixed memory corruption in pg_copy_from() in case the as_null parameter was http://cvs.php.net/diff.php/php-src/ext/pgsql/pgsql.c?r1=1.329r2=1.330ty=u Index: php-src/ext/pgsql/pgsql.c diff -u php-src/ext/pgsql/pgsql.c:1.329 php-src/ext/pgsql/pgsql.c:1.330 --- php-src/ext/pgsql/pgsql.c:1.329 Tue Jul 5 10:49:22 2005 +++ php-src/ext/pgsql/pgsql.c Thu Jul 7 20:40:32 2005 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: pgsql.c,v 1.329 2005/07/05 14:49:22 edink Exp $ */ +/* $Id: pgsql.c,v 1.330 2005/07/08 00:40:32 iliaa Exp $ */ #include stdlib.h @@ -127,6 +127,7 @@ PHP_FE(pg_fetch_array, NULL) PHP_FE(pg_fetch_object, NULL) PHP_FE(pg_fetch_all,NULL) + PHP_FE(pg_fetch_all_columns,NULL) #if HAVE_PQCMDTUPLES PHP_FE(pg_affected_rows,NULL) #endif @@ -2101,6 +2102,47 @@ } /* }}} */ +/* {{{ proto array pg_fetch_all_columns(resource result [, int column_number]) + Fetch all rows into array */ +PHP_FUNCTION(pg_fetch_all_columns) +{ + zval *result; + PGresult *pgsql_result; + pgsql_result_handle *pg_result; + long colno=0; + int pg_numrows, pg_row; + size_t num_fields; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r|l, result, colno) == FAILURE) { + RETURN_FALSE; + } + + ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, result, -1, PostgreSQL result, le_result); + + pgsql_result = pg_result-result; + + num_fields = PQnfields(pgsql_result); + if (colno = num_fields || colno 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid column number '%ld', colno); + RETURN_FALSE; + } + + array_init(return_value); + +if ((pg_numrows = PQntuples(pgsql_result)) = 0) { + return; + } + + for (pg_row = 0; pg_row pg_numrows; pg_row++) { + if (PQgetisnull(pgsql_result, pg_row, colno)) { + add_next_index_null(return_value); + } else { + add_next_index_string(return_value, PQgetvalue(pgsql_result, pg_row, colno), 1); + } + } +} +/* }}} */ + /* {{{ proto bool pg_result_seek(resource result, int offset) Set internal row offset */ PHP_FUNCTION(pg_result_seek) http://cvs.php.net/diff.php/php-src/ext/pgsql/php_pgsql.h?r1=1.71r2=1.72ty=u Index: php-src/ext/pgsql/php_pgsql.h diff -u php-src/ext/pgsql/php_pgsql.h:1.71 php-src/ext/pgsql/php_pgsql.h:1.72 --- php-src/ext/pgsql/php_pgsql.h:1.71 Wed Apr 13 17:48:33 2005 +++ php-src/ext/pgsql/php_pgsql.h Thu Jul 7 20:40:32 2005 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_pgsql.h,v 1.71 2005/04/13 21:48:33 derick Exp $ */ +/* $Id: php_pgsql.h,v 1.72 2005/07/08 00:40:32 iliaa Exp $ */ #ifndef PHP_PGSQL_H #define PHP_PGSQL_H @@ -107,6 +107,7 @@ PHP_FUNCTION(pg_fetch_result); PHP_FUNCTION(pg_fetch_row); PHP_FUNCTION(pg_fetch_all); +PHP_FUNCTION(pg_fetch_all_columns); #if HAVE_PQCMDTUPLES PHP_FUNCTION(pg_affected_rows); #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src / NEWS /ext/pgsql pgsql.c php_pgsql.h
Docs? Ilia Alshanetsky wrote: iliaa Thu Jul 7 20:40:33 2005 EDT Modified files: /php-src NEWS /php-src/ext/pgsql pgsql.c php_pgsql.h Log: Added pg_fetch_all_columns() function to fetch all values of a column from a result cursor. http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1987r2=1.1988ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1987 php-src/NEWS:1.1988 --- php-src/NEWS:1.1987 Thu Jul 7 12:07:08 2005 +++ php-src/NEWSThu Jul 7 20:40:32 2005 @@ -5,6 +5,8 @@ - Added PDO_MYSQL_ATTR_USE_BUFFERED_QUERY parameter for pdo_mysql. (Ilia) - Added date_timezone_set() function to set the timezone that the date functions will use. (Derick) +- Added pg_fetch_all_columns() function to fetch all values of a column from + a result cursor. (Ilia) - Implemented feature request #33452 (Year belonging to ISO week). (Derick) - Fixed support for shared extensions on AIX. (Dmitry) - Fixed memory corruption in pg_copy_from() in case the as_null parameter was http://cvs.php.net/diff.php/php-src/ext/pgsql/pgsql.c?r1=1.329r2=1.330ty=u Index: php-src/ext/pgsql/pgsql.c diff -u php-src/ext/pgsql/pgsql.c:1.329 php-src/ext/pgsql/pgsql.c:1.330 --- php-src/ext/pgsql/pgsql.c:1.329 Tue Jul 5 10:49:22 2005 +++ php-src/ext/pgsql/pgsql.c Thu Jul 7 20:40:32 2005 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: pgsql.c,v 1.329 2005/07/05 14:49:22 edink Exp $ */ +/* $Id: pgsql.c,v 1.330 2005/07/08 00:40:32 iliaa Exp $ */ #include stdlib.h @@ -127,6 +127,7 @@ PHP_FE(pg_fetch_array, NULL) PHP_FE(pg_fetch_object, NULL) PHP_FE(pg_fetch_all,NULL) + PHP_FE(pg_fetch_all_columns,NULL) #if HAVE_PQCMDTUPLES PHP_FE(pg_affected_rows,NULL) #endif @@ -2101,6 +2102,47 @@ } /* }}} */ +/* {{{ proto array pg_fetch_all_columns(resource result [, int column_number]) + Fetch all rows into array */ +PHP_FUNCTION(pg_fetch_all_columns) +{ + zval *result; + PGresult *pgsql_result; + pgsql_result_handle *pg_result; + long colno=0; + int pg_numrows, pg_row; + size_t num_fields; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r|l, result, colno) == FAILURE) { + RETURN_FALSE; + } + + ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, result, -1, PostgreSQL result, le_result); + + pgsql_result = pg_result-result; + + num_fields = PQnfields(pgsql_result); + if (colno = num_fields || colno 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid column number '%ld', colno); + RETURN_FALSE; + } + + array_init(return_value); + +if ((pg_numrows = PQntuples(pgsql_result)) = 0) { + return; + } + + for (pg_row = 0; pg_row pg_numrows; pg_row++) { + if (PQgetisnull(pgsql_result, pg_row, colno)) { + add_next_index_null(return_value); + } else { + add_next_index_string(return_value, PQgetvalue(pgsql_result, pg_row, colno), 1); + } + } +} +/* }}} */ + /* {{{ proto bool pg_result_seek(resource result, int offset) Set internal row offset */ PHP_FUNCTION(pg_result_seek) http://cvs.php.net/diff.php/php-src/ext/pgsql/php_pgsql.h?r1=1.71r2=1.72ty=u Index: php-src/ext/pgsql/php_pgsql.h diff -u php-src/ext/pgsql/php_pgsql.h:1.71 php-src/ext/pgsql/php_pgsql.h:1.72 --- php-src/ext/pgsql/php_pgsql.h:1.71 Wed Apr 13 17:48:33 2005 +++ php-src/ext/pgsql/php_pgsql.h Thu Jul 7 20:40:32 2005 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_pgsql.h,v 1.71 2005/04/13 21:48:33 derick Exp $ */ +/* $Id: php_pgsql.h,v 1.72 2005/07/08 00:40:32 iliaa Exp $ */ #ifndef PHP_PGSQL_H #define PHP_PGSQL_H @@ -107,6 +107,7 @@ PHP_FUNCTION(pg_fetch_result); PHP_FUNCTION(pg_fetch_row); PHP_FUNCTION(pg_fetch_all); +PHP_FUNCTION(pg_fetch_all_columns); #if HAVE_PQCMDTUPLES PHP_FUNCTION(pg_affected_rows); #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src / NEWS /ext/pgsql pgsql.c php_pgsql.h
Send a patch to the docs list? On Fri, 08 Jul 2005 15:48:38 +0800 Christopher Kings-Lynne [EMAIL PROTECTED] wrote: Docs? Ilia Alshanetsky wrote: iliaa Thu Jul 7 20:40:33 2005 EDT Modified files: /php-srcNEWS /php-src/ext/pgsql pgsql.c php_pgsql.h Log: Added pg_fetch_all_columns() function to fetch all values of a column from a result cursor. http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1987r2=1.1988ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1987 php-src/NEWS:1.1988 --- php-src/NEWS:1.1987 Thu Jul 7 12:07:08 2005 +++ php-src/NEWSThu Jul 7 20:40:32 2005 @@ -5,6 +5,8 @@ - Added PDO_MYSQL_ATTR_USE_BUFFERED_QUERY parameter for pdo_mysql. (Ilia) - Added date_timezone_set() function to set the timezone that the date functions will use. (Derick) +- Added pg_fetch_all_columns() function to fetch all values of a column from + a result cursor. (Ilia) - Implemented feature request #33452 (Year belonging to ISO week). (Derick) - Fixed support for shared extensions on AIX. (Dmitry) - Fixed memory corruption in pg_copy_from() in case the as_null parameter was http://cvs.php.net/diff.php/php-src/ext/pgsql/pgsql.c?r1=1.329r2=1.330ty=u Index: php-src/ext/pgsql/pgsql.c diff -u php-src/ext/pgsql/pgsql.c:1.329 php-src/ext/pgsql/pgsql.c:1.330 --- php-src/ext/pgsql/pgsql.c:1.329 Tue Jul 5 10:49:22 2005 +++ php-src/ext/pgsql/pgsql.c Thu Jul 7 20:40:32 2005 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: pgsql.c,v 1.329 2005/07/05 14:49:22 edink Exp $ */ +/* $Id: pgsql.c,v 1.330 2005/07/08 00:40:32 iliaa Exp $ */ #include stdlib.h @@ -127,6 +127,7 @@ PHP_FE(pg_fetch_array, NULL) PHP_FE(pg_fetch_object, NULL) PHP_FE(pg_fetch_all,NULL) + PHP_FE(pg_fetch_all_columns,NULL) #if HAVE_PQCMDTUPLES PHP_FE(pg_affected_rows,NULL) #endif @@ -2101,6 +2102,47 @@ } /* }}} */ +/* {{{ proto array pg_fetch_all_columns(resource result [, int column_number]) + Fetch all rows into array */ +PHP_FUNCTION(pg_fetch_all_columns) +{ + zval *result; + PGresult *pgsql_result; + pgsql_result_handle *pg_result; + long colno=0; + int pg_numrows, pg_row; + size_t num_fields; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r|l, result, colno) == FAILURE) { + RETURN_FALSE; + } + + ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, result, -1, PostgreSQL result, le_result); + + pgsql_result = pg_result-result; + + num_fields = PQnfields(pgsql_result); + if (colno = num_fields || colno 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid column number '%ld', colno); + RETURN_FALSE; + } + + array_init(return_value); + +if ((pg_numrows = PQntuples(pgsql_result)) = 0) { + return; + } + + for (pg_row = 0; pg_row pg_numrows; pg_row++) { + if (PQgetisnull(pgsql_result, pg_row, colno)) { + add_next_index_null(return_value); + } else { + add_next_index_string(return_value, PQgetvalue(pgsql_result, pg_row, colno), 1); + } + } +} +/* }}} */ + /* {{{ proto bool pg_result_seek(resource result, int offset) Set internal row offset */ PHP_FUNCTION(pg_result_seek) http://cvs.php.net/diff.php/php-src/ext/pgsql/php_pgsql.h?r1=1.71r2=1.72ty=u Index: php-src/ext/pgsql/php_pgsql.h diff -u php-src/ext/pgsql/php_pgsql.h:1.71 php-src/ext/pgsql/php_pgsql.h:1.72 --- php-src/ext/pgsql/php_pgsql.h:1.71 Wed Apr 13 17:48:33 2005 +++ php-src/ext/pgsql/php_pgsql.h Thu Jul 7 20:40:32 2005 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_pgsql.h,v 1.71 2005/04/13 21:48:33 derick Exp $ */ +/* $Id: php_pgsql.h,v 1.72 2005/07/08 00:40:32 iliaa Exp $ */ #ifndef PHP_PGSQL_H #define PHP_PGSQL_H @@ -107,6 +107,7 @@ PHP_FUNCTION(pg_fetch_result); PHP_FUNCTION(pg_fetch_row); PHP_FUNCTION(pg_fetch_all); +PHP_FUNCTION(pg_fetch_all_columns); #if HAVE_PQCMDTUPLES PHP_FUNCTION(pg_affected_rows); #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Wbr, Antony Dovgal -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / NEWS /ext/pgsql pgsql.c php_pgsql.h
iliaa Thu Jul 7 20:40:33 2005 EDT Modified files: /php-srcNEWS /php-src/ext/pgsql pgsql.c php_pgsql.h Log: Added pg_fetch_all_columns() function to fetch all values of a column from a result cursor. http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1987r2=1.1988ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1987 php-src/NEWS:1.1988 --- php-src/NEWS:1.1987 Thu Jul 7 12:07:08 2005 +++ php-src/NEWSThu Jul 7 20:40:32 2005 @@ -5,6 +5,8 @@ - Added PDO_MYSQL_ATTR_USE_BUFFERED_QUERY parameter for pdo_mysql. (Ilia) - Added date_timezone_set() function to set the timezone that the date functions will use. (Derick) +- Added pg_fetch_all_columns() function to fetch all values of a column from + a result cursor. (Ilia) - Implemented feature request #33452 (Year belonging to ISO week). (Derick) - Fixed support for shared extensions on AIX. (Dmitry) - Fixed memory corruption in pg_copy_from() in case the as_null parameter was http://cvs.php.net/diff.php/php-src/ext/pgsql/pgsql.c?r1=1.329r2=1.330ty=u Index: php-src/ext/pgsql/pgsql.c diff -u php-src/ext/pgsql/pgsql.c:1.329 php-src/ext/pgsql/pgsql.c:1.330 --- php-src/ext/pgsql/pgsql.c:1.329 Tue Jul 5 10:49:22 2005 +++ php-src/ext/pgsql/pgsql.c Thu Jul 7 20:40:32 2005 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: pgsql.c,v 1.329 2005/07/05 14:49:22 edink Exp $ */ +/* $Id: pgsql.c,v 1.330 2005/07/08 00:40:32 iliaa Exp $ */ #include stdlib.h @@ -127,6 +127,7 @@ PHP_FE(pg_fetch_array, NULL) PHP_FE(pg_fetch_object, NULL) PHP_FE(pg_fetch_all,NULL) + PHP_FE(pg_fetch_all_columns,NULL) #if HAVE_PQCMDTUPLES PHP_FE(pg_affected_rows,NULL) #endif @@ -2101,6 +2102,47 @@ } /* }}} */ +/* {{{ proto array pg_fetch_all_columns(resource result [, int column_number]) + Fetch all rows into array */ +PHP_FUNCTION(pg_fetch_all_columns) +{ + zval *result; + PGresult *pgsql_result; + pgsql_result_handle *pg_result; + long colno=0; + int pg_numrows, pg_row; + size_t num_fields; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r|l, result, colno) == FAILURE) { + RETURN_FALSE; + } + + ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, result, -1, PostgreSQL result, le_result); + + pgsql_result = pg_result-result; + + num_fields = PQnfields(pgsql_result); + if (colno = num_fields || colno 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid column number '%ld', colno); + RETURN_FALSE; + } + + array_init(return_value); + +if ((pg_numrows = PQntuples(pgsql_result)) = 0) { + return; + } + + for (pg_row = 0; pg_row pg_numrows; pg_row++) { + if (PQgetisnull(pgsql_result, pg_row, colno)) { + add_next_index_null(return_value); + } else { + add_next_index_string(return_value, PQgetvalue(pgsql_result, pg_row, colno), 1); + } + } +} +/* }}} */ + /* {{{ proto bool pg_result_seek(resource result, int offset) Set internal row offset */ PHP_FUNCTION(pg_result_seek) http://cvs.php.net/diff.php/php-src/ext/pgsql/php_pgsql.h?r1=1.71r2=1.72ty=u Index: php-src/ext/pgsql/php_pgsql.h diff -u php-src/ext/pgsql/php_pgsql.h:1.71 php-src/ext/pgsql/php_pgsql.h:1.72 --- php-src/ext/pgsql/php_pgsql.h:1.71 Wed Apr 13 17:48:33 2005 +++ php-src/ext/pgsql/php_pgsql.h Thu Jul 7 20:40:32 2005 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_pgsql.h,v 1.71 2005/04/13 21:48:33 derick Exp $ */ +/* $Id: php_pgsql.h,v 1.72 2005/07/08 00:40:32 iliaa Exp $ */ #ifndef PHP_PGSQL_H #define PHP_PGSQL_H @@ -107,6 +107,7 @@ PHP_FUNCTION(pg_fetch_result); PHP_FUNCTION(pg_fetch_row); PHP_FUNCTION(pg_fetch_all); +PHP_FUNCTION(pg_fetch_all_columns); #if HAVE_PQCMDTUPLES PHP_FUNCTION(pg_affected_rows); #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / NEWS /ext/pgsql pgsql.c php_pgsql.h
edink Mon Feb 14 18:36:16 2005 EDT Modified files: /php-srcNEWS /php-src/ext/pgsql pgsql.c php_pgsql.h Log: Added pg_field_type_oid() function http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1841r2=1.1842ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1841 php-src/NEWS:1.1842 --- php-src/NEWS:1.1841 Thu Feb 10 06:45:22 2005 +++ php-src/NEWSMon Feb 14 18:36:15 2005 @@ -1,6 +1,7 @@ PHPNEWS ||| ?? ??? 2004, PHP 5.1.0 +- Added pg_field_type_oid() PostgreSQL function. (mauroi at digbang dot com) - Added zend_declare_property_...() and zend_update_property_...() API functions for bool, double and binary safe strings. (Hartmut) - Moved extensions to PECL: http://cvs.php.net/diff.php/php-src/ext/pgsql/pgsql.c?r1=1.312r2=1.313ty=u Index: php-src/ext/pgsql/pgsql.c diff -u php-src/ext/pgsql/pgsql.c:1.312 php-src/ext/pgsql/pgsql.c:1.313 --- php-src/ext/pgsql/pgsql.c:1.312 Mon Jul 19 03:19:42 2004 +++ php-src/ext/pgsql/pgsql.c Mon Feb 14 18:36:16 2005 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: pgsql.c,v 1.312 2004/07/19 07:19:42 andi Exp $ */ +/* $Id: pgsql.c,v 1.313 2005/02/14 23:36:16 edink Exp $ */ #include stdlib.h @@ -117,6 +117,7 @@ PHP_FE(pg_field_num,NULL) PHP_FE(pg_field_size, NULL) PHP_FE(pg_field_type, NULL) + PHP_FE(pg_field_type_oid, NULL) PHP_FE(pg_field_prtlen, NULL) PHP_FE(pg_field_is_null,NULL) /* async message function */ @@ -1251,6 +1252,7 @@ #define PHP_PG_FIELD_NAME 1 #define PHP_PG_FIELD_SIZE 2 #define PHP_PG_FIELD_TYPE 3 +#define PHP_PG_FIELD_TYPE_OID 4 /* {{{ php_pgsql_get_field_info */ @@ -1259,6 +1261,7 @@ zval **result, **field; PGresult *pgsql_result; pgsql_result_handle *pg_result; + Oid oid; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, result, field)==FAILURE) { WRONG_PARAM_COUNT; @@ -1290,6 +1293,24 @@ Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); Z_TYPE_P(return_value) = IS_STRING; break; + case PHP_PG_FIELD_TYPE_OID: + + oid = PQftype(pgsql_result, Z_LVAL_PP(field)); + + if (oid LONG_MAX) { + smart_str s = {0}; + smart_str_append_unsigned(s, oid); + smart_str_0(s); + Z_STRVAL_P(return_value) = s.c; + Z_STRLEN_P(return_value) = s.len; + Z_TYPE_P(return_value) = IS_STRING; + } + else + { + Z_LVAL_P(return_value) = (long)oid; + Z_TYPE_P(return_value) = IS_LONG; + } + break; default: RETURN_FALSE; } @@ -1320,6 +1341,15 @@ } /* }}} */ + +/* {{{ proto string pg_field_type_oid(resource result, int field_number) + Returns the type oid for the given field */ +PHP_FUNCTION(pg_field_type_oid) +{ + php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_FIELD_TYPE_OID); +} +/* }}} */ + /* {{{ proto int pg_field_num(resource result, string field_name) Returns the field number of the named field */ PHP_FUNCTION(pg_field_num) http://cvs.php.net/diff.php/php-src/ext/pgsql/php_pgsql.h?r1=1.67r2=1.68ty=u Index: php-src/ext/pgsql/php_pgsql.h diff -u php-src/ext/pgsql/php_pgsql.h:1.67 php-src/ext/pgsql/php_pgsql.h:1.68 --- php-src/ext/pgsql/php_pgsql.h:1.67 Thu Jan 8 12:32:40 2004 +++ php-src/ext/pgsql/php_pgsql.h Mon Feb 14 18:36:16 2005 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_pgsql.h,v 1.67 2004/01/08 17:32:40 sniper Exp $ */ +/* $Id: php_pgsql.h,v 1.68 2005/02/14 23:36:16 edink Exp $ */ #ifndef PHP_PGSQL_H #define PHP_PGSQL_H @@ -98,6 +98,7 @@ PHP_FUNCTION(pg_field_num); PHP_FUNCTION(pg_field_size); PHP_FUNCTION(pg_field_type); +PHP_FUNCTION(pg_field_type_oid); PHP_FUNCTION(pg_field_prtlen); PHP_FUNCTION(pg_field_is_null); /* async message functions */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php