/* result functions */
PHP_FE(pg_fetch_result, NULL)
PHP_FE(pg_fetch_row, NULL)
+ PHP_FE(pg_fetch_assoc, NULL)
PHP_FE(pg_fetch_array, NULL)
PHP_FE(pg_fetch_object, NULL)
PHP_FE(pg_fetch_all, NULL)
}
/* }}} */
+/* {{{ proto array pg_fetch_assoc(resource result [, int row])
+ Fetch a row as an assoc array */
+PHP_FUNCTION(pg_fetch_assoc)
+{
+ /* pg_fetch_assoc() is added from PHP 4.3.0. It should raise error, when
+ there is 3rd parameter */
+ if (ZEND_NUM_ARGS() > 2)
+ WRONG_PARAM_COUNT;
+ php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, PGSQL_ASSOC);
+}
+/* }}} */
+
/* {{{ proto array pg_fetch_array(resource result [, int row [, int result_type]])
Fetch a row as an array */
PHP_FUNCTION(pg_fetch_array)
}
/* }}} */
-/* {{{ proto object pg_fetch_object(resource result [, int row[, int result_type]])
+/* {{{ proto object pg_fetch_object(resource result [, int row])
Fetch a row as an object */
PHP_FUNCTION(pg_fetch_object)
{
+ /* pg_fetch_object() allowed result_type used to be. 3rd parameter
+ must be allowed for compatibility */
php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, PGSQL_ASSOC);
if (Z_TYPE_P(return_value)==IS_ARRAY) {
object_and_properties_init(return_value, ZEND_STANDARD_CLASS_DEF_PTR, Z_ARRVAL_P(return_value));
}
/* }}} */
-/* {{{ proto bool pg_insert(resource db, string table, array values[, int options])
+/* {{{ proto mixed pg_insert(resource db, string table, array values[, int options])
Insert values (filed=>value) to table */
PHP_FUNCTION(pg_insert)
{
}
/* }}} */
-/* {{{ proto bool pg_update(resource db, string table, array fields, array ids[, int options])
+/* {{{ proto mixed pg_update(resource db, string table, array fields, array ids[, int options])
Update table using values (field=>value) and ids (id=>value) */
PHP_FUNCTION(pg_update)
{
}
/* }}} */
-/* {{{ proto bool pg_delete(resource db, string table, array ids[, int options])
+/* {{{ proto mixed pg_delete(resource db, string table, array ids[, int options])
Delete records has ids (id=>value) */
PHP_FUNCTION(pg_delete)
{
}
/* }}} */
-/* {{{ proto array pg_select(resource db, string table, array ids[, int options])
+/* {{{ proto mixed pg_select(resource db, string table, array ids[, int options])
Select records that has ids (id=>value) */
PHP_FUNCTION(pg_select)
{
PHP_FUNCTION(pg_send_query);
PHP_FUNCTION(pg_cancel_query);
/* result functions */
+PHP_FUNCTION(pg_fetch_assoc);
PHP_FUNCTION(pg_fetch_array);
PHP_FUNCTION(pg_fetch_object);
PHP_FUNCTION(pg_fetch_result);
#define PGSQL_CONV_IGNORE_NOT_NULL (1<<3) /* Ignore NOT NULL constraints */
#define PGSQL_CONV_OPTS (PGSQL_CONV_IGNORE_DEFAULT|PGSQL_CONV_FORCE_NULL|PGSQL_CONV_IGNORE_NOT_NULL)
/* php_pgsql_insert/update/select/delete options */
-#define PGSQL_DML_NO_CONV (1<<8) /* Call php_pgsql_convert() */
+#define PGSQL_DML_NO_CONV (1<<8) /* Do not call php_pgsql_convert() */
#define PGSQL_DML_EXEC (1<<9) /* Execute query */
#define PGSQL_DML_ASYNC (1<<10) /* Do async query */
#define PGSQL_DML_STRING (1<<11) /* Return query string */