Skip to content

Commit 8d8f148

Browse files
author
Harald Radi
committed
added mssql_fetch_assoc() to be more mysql conform
changed mssql_fetch_array() back to its default behaviour (MSSQL_BOTH)
1 parent 34feef0 commit 8d8f148

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

ext/mssql/php_mssql.c

+10-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ function_entry mssql_functions[] = {
6363
PHP_FE(mssql_fetch_field, NULL)
6464
PHP_FE(mssql_fetch_row, NULL)
6565
PHP_FE(mssql_fetch_array, NULL)
66+
PHP_FE(mssql_fetch_assoc, NULL)
6667
PHP_FE(mssql_fetch_object, NULL)
6768
PHP_FE(mssql_field_length, NULL)
6869
PHP_FE(mssql_field_name, NULL)
@@ -1280,11 +1281,19 @@ PHP_FUNCTION(mssql_fetch_object)
12801281
Returns an associative array of the current row in the result set specified by result_id */
12811282
PHP_FUNCTION(mssql_fetch_array)
12821283
{
1283-
php_mssql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MSSQL_ASSOC);
1284+
php_mssql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MSSQL_BOTH);
12841285
}
12851286

12861287
/* }}} */
12871288

1289+
/* {{{ proto array mssql_fetch_array(int result_id [, int result_type])
1290+
Returns an associative array of the current row in the result set specified by result_id */
1291+
PHP_FUNCTION(mssql_fetch_assoc)
1292+
{
1293+
php_mssql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, MSSQL_ASSOC);
1294+
}
1295+
1296+
/* }}} */
12881297

12891298
/* {{{ proto int mssql_data_seek(int result_id, int offset)
12901299
Moves the internal row pointer of the MS-SQL result associated with the specified result identifier to pointer to the specified row number */

ext/mssql/php_mssql.h

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ PHP_FUNCTION(mssql_num_fields);
7070
PHP_FUNCTION(mssql_fetch_field);
7171
PHP_FUNCTION(mssql_fetch_row);
7272
PHP_FUNCTION(mssql_fetch_array);
73+
PHP_FUNCTION(mssql_fetch_assoc);
7374
PHP_FUNCTION(mssql_fetch_object);
7475
PHP_FUNCTION(mssql_field_length);
7576
PHP_FUNCTION(mssql_field_name);

0 commit comments

Comments
 (0)