Skip to content

Commit 09e0018

Browse files
author
Brian Moon
committed
added mysql_fetch_assoc. Acts like mysql_fetch_array used to.
1 parent 7b6d8bf commit 09e0018

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

ext/mysql/php_mysql.c

+10-1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ function_entry mysql_functions[] = {
108108
PHP_FE(mysql_num_fields, NULL)
109109
PHP_FE(mysql_fetch_row, NULL)
110110
PHP_FE(mysql_fetch_array, NULL)
111+
PHP_FE(mysql_fetch_assoc, NULL)
111112
PHP_FE(mysql_fetch_object, NULL)
112113
PHP_FE(mysql_data_seek, NULL)
113114
PHP_FE(mysql_fetch_lengths, NULL)
@@ -1352,14 +1353,22 @@ PHP_FUNCTION(mysql_fetch_object)
13521353

13531354

13541355
/* {{{ proto array mysql_fetch_array(int result [, int result_type])
1355-
Fetch a result row as an associative array */
1356+
Fetch a result row as an array (associative, numeric or both)*/
13561357
PHP_FUNCTION(mysql_fetch_array)
13571358
{
13581359
php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
13591360
}
13601361
/* }}} */
13611362

13621363

1364+
/* {{{ proto array mysql_fetch_assoc(int result)
1365+
Fetch a result row as an associative array */
1366+
PHP_FUNCTION(mysql_fetch_assoc)
1367+
{
1368+
php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MYSQL_ASSOC);
1369+
}
1370+
/* }}} */
1371+
13631372
/* {{{ proto int mysql_data_seek(int result, int row_number)
13641373
Move internal result pointer */
13651374
PHP_FUNCTION(mysql_data_seek)

ext/mysql/php_mysql.h

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ PHP_FUNCTION(mysql_num_rows);
6363
PHP_FUNCTION(mysql_num_fields);
6464
PHP_FUNCTION(mysql_fetch_row);
6565
PHP_FUNCTION(mysql_fetch_array);
66+
PHP_FUNCTION(mysql_fetch_assoc);
6667
PHP_FUNCTION(mysql_fetch_object);
6768
PHP_FUNCTION(mysql_data_seek);
6869
PHP_FUNCTION(mysql_fetch_lengths);

0 commit comments

Comments
 (0)