summaryrefslogtreecommitdiff
path: root/ext/mysql/php_mysql.c
diff options
context:
space:
mode:
authorAndrei Zmievski <andrei@php.net>2000-05-15 13:46:37 +0000
committerAndrei Zmievski <andrei@php.net>2000-05-15 13:46:37 +0000
commitfe24b820bebea6cbdb41b375f30d95f6979a6161 (patch)
treeba98c1e97bf6737def714e3ecdca9193c31a74a8 /ext/mysql/php_mysql.c
parent10503a3b92619a63a7873f0c1bc81c16486ff370 (diff)
downloadphp-git-fe24b820bebea6cbdb41b375f30d95f6979a6161.tar.gz
@- NULL values are now preserved in the return value of mysql_fetch_array()
@ and mysql_fetch_object(). (Andrei)
Diffstat (limited to 'ext/mysql/php_mysql.c')
-rw-r--r--ext/mysql/php_mysql.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 94fda3bf4a..def28dafed 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -1317,8 +1317,11 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
add_assoc_stringl(return_value, mysql_field->name, data, data_len, should_copy);
}
} else {
- /* NULL field, don't set it */
- /* add_get_index_stringl(return_value, i, empty_string, 0, (void **) &pval_ptr); */
+ /* NULL value. */
+ if (result_type & MYSQL_NUM)
+ add_index_unset(return_value, i);
+ else
+ add_assoc_unset(return_value, mysql_field->name);
}
}
}