]> granicus.if.org Git - php/commitdiff
added mysql_fetch_assoc. Acts like mysql_fetch_array used to.
authorBrian Moon <brianlmoon@php.net>
Wed, 20 Sep 2000 21:43:57 +0000 (21:43 +0000)
committerBrian Moon <brianlmoon@php.net>
Wed, 20 Sep 2000 21:43:57 +0000 (21:43 +0000)
ext/mysql/php_mysql.c
ext/mysql/php_mysql.h

index ac87d54226de667c15e8667250d65eaef291ee1e..c77cdd2a9e678a1645f3ceb29bd9fa8e416f6339 100644 (file)
@@ -108,6 +108,7 @@ function_entry mysql_functions[] = {
        PHP_FE(mysql_num_fields,                                                        NULL)
        PHP_FE(mysql_fetch_row,                                                         NULL)
        PHP_FE(mysql_fetch_array,                                                       NULL)
+       PHP_FE(mysql_fetch_assoc,                                                       NULL)
        PHP_FE(mysql_fetch_object,                                                      NULL)
        PHP_FE(mysql_data_seek,                                                         NULL)
        PHP_FE(mysql_fetch_lengths,                                                     NULL)
@@ -1352,7 +1353,7 @@ PHP_FUNCTION(mysql_fetch_object)
 
 
 /* {{{ proto array mysql_fetch_array(int result [, int result_type])
-   Fetch a result row as an associative array */
+   Fetch a result row as an array (associative, numeric or both)*/
 PHP_FUNCTION(mysql_fetch_array)
 {
        php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
@@ -1360,6 +1361,14 @@ PHP_FUNCTION(mysql_fetch_array)
 /* }}} */
 
 
+/* {{{ proto array mysql_fetch_assoc(int result)
+   Fetch a result row as an associative array */
+PHP_FUNCTION(mysql_fetch_assoc)
+{
+       php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MYSQL_ASSOC);
+}
+/* }}} */
+
 /* {{{ proto int mysql_data_seek(int result, int row_number)
    Move internal result pointer */
 PHP_FUNCTION(mysql_data_seek)
index be3a88b25bc51e1193edf56c722db18e6695044e..21de02e71da9b0c128d5e13b4fd769080bf87c0f 100644 (file)
@@ -63,6 +63,7 @@ PHP_FUNCTION(mysql_num_rows);
 PHP_FUNCTION(mysql_num_fields);
 PHP_FUNCTION(mysql_fetch_row);
 PHP_FUNCTION(mysql_fetch_array);
+PHP_FUNCTION(mysql_fetch_assoc);
 PHP_FUNCTION(mysql_fetch_object);
 PHP_FUNCTION(mysql_data_seek);
 PHP_FUNCTION(mysql_fetch_lengths);