]> granicus.if.org Git - php/commitdiff
- Fix Bug #31960: msql_fetch_row() and msql_fetch_array() dropping columns with NULL...
authorAndi Gutmans <andi@php.net>
Thu, 17 Feb 2005 20:11:20 +0000 (20:11 +0000)
committerAndi Gutmans <andi@php.net>
Thu, 17 Feb 2005 20:11:20 +0000 (20:11 +0000)
ext/msql/php_msql.c

index 93522865b27160ecb80ad2f7c0c9bc1dee268179..6a7231bba20b13a345cba6a57a78a720c2d07cf7 100644 (file)
@@ -958,9 +958,14 @@ static void php_msql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
                                add_assoc_stringl(return_value, msql_field->name, data, data_len, should_copy);
                        }
                } else {
-                       /*
-                       add_get_index_stringl(return_value, i, "", 0, (void **) &pval_ptr, 1);
-                       */
+                       /* NULL value. */
+                       if (result_type & MSQL_NUM) {
+                               add_index_null(return_value, i);
+                       }
+
+                       if (result_type & MSQL_ASSOC) {
+                               add_assoc_null(return_value, msql_field->name);
+                       }
                }
        }
 }