]> granicus.if.org Git - php/commitdiff
Just adding in an error check that seems to work here well.
authorDan Kalowsky <kalowsky@php.net>
Wed, 31 Jul 2002 13:50:51 +0000 (13:50 +0000)
committerDan Kalowsky <kalowsky@php.net>
Wed, 31 Jul 2002 13:50:51 +0000 (13:50 +0000)
ext/odbc/php_odbc.c

index bf5a613f7fdc49fbaefa0b351bca138a1522290e..dac5901b8c4fce1a38d5549558e82637e9618938 100644 (file)
@@ -1631,6 +1631,11 @@ PHP_FUNCTION(odbc_result)
        
        /* get field index if the field parameter was a string */
        if (field != NULL) {
+               if (result->values == NULL) {
+                       php_error(E_WARNING, "Result set contains no data");
+                       RETURN_FALSE;
+               }
+
                for(i = 0; i < result->numcols; i++) {
                        if (!strcasecmp(result->values[i].name, field)) {
                                field_ind = i;