]> granicus.if.org Git - php/commitdiff
Make fbsql_list_fields work as documented
authorFrank M. Kromann <fmk@php.net>
Sat, 10 Nov 2001 07:43:23 +0000 (07:43 +0000)
committerFrank M. Kromann <fmk@php.net>
Sat, 10 Nov 2001 07:43:23 +0000 (07:43 +0000)
ext/fbsql/php_fbsql.c

index b6668fa34405847fd5222949a4d203a9efa636a3..faafa24ccb0e806dc662ea9b90b432e66aa985d5 100644 (file)
@@ -2014,7 +2014,7 @@ PHP_FUNCTION(fbsql_list_fields)
                RETURN_FALSE;
        }
 
-       sprintf(sql, "EXTRACT TABLE %s;", tableName);
+       sprintf(sql, "SELECT * FROM %s WHERE 1=0;", tableName);
 
        phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, sql, phpLink);
 }
@@ -2738,12 +2738,9 @@ static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
                        char* key;
                        FBCPList* value;
 
-                       if (result->rowCount == 0 || result->rowIndex >= result->rowCount) {
-                               RETURN_FALSE;
-                       }
-
                        value = (FBCPList*)fbcplValueAtIndex(result->list, result->rowIndex);
                        key = (char*)fbcplKeyAtIndex(result->list, result->rowIndex);
+
                        if (key && key[0] == 2)
                                key = NULL;