diff options
| author | Marcus Boerger <helly@php.net> | 2003-09-06 19:34:48 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2003-09-06 19:34:48 +0000 |
| commit | 1ae13e543a6d959d3ad43081f7e73a239c2b19d9 (patch) | |
| tree | 11eca52571ca91372fecb685f9e785f27a816247 /ext/mysqli/mysqli_nonapi.c | |
| parent | f6239c33bc5208fd3e9e6bf0f8a862b1f97a34d8 (diff) | |
| download | php-git-1ae13e543a6d959d3ad43081f7e73a239c2b19d9.tar.gz | |
Modify mysqli_fetch_object() to be able to instantiate a selected class and
pass parameters to the constructor.
Diffstat (limited to 'ext/mysqli/mysqli_nonapi.c')
| -rw-r--r-- | ext/mysqli/mysqli_nonapi.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index e98253c714..6d43be1768 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -120,7 +120,7 @@ PHP_FUNCTION(mysqli_connect_error) Fetch a result row as an associative array, a numeric array, or both */ PHP_FUNCTION(mysqli_fetch_array) { - php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); + php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0, 0); } /* }}} */ @@ -128,19 +128,15 @@ PHP_FUNCTION(mysqli_fetch_array) Fetch a result row as an associative array */ PHP_FUNCTION(mysqli_fetch_assoc) { - php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MYSQLI_ASSOC); + php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MYSQLI_ASSOC, 0); } /* }}} */ -/* {{{ proto array mysqli_fetch_object (object result) +/* {{{ proto array mysqli_fetch_object (object result [, string class_name [, NULL|array ctor_params]]) Fetch a result row as an object */ PHP_FUNCTION(mysqli_fetch_object) { - php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MYSQLI_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)); - } + php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MYSQLI_ASSOC, 1); } /* }}} */ |
