]> granicus.if.org Git - php/commitdiff
Return proper result.
authorYasuo Ohgaki <yohgaki@php.net>
Mon, 8 Apr 2002 00:50:44 +0000 (00:50 +0000)
committerYasuo Ohgaki <yohgaki@php.net>
Mon, 8 Apr 2002 00:50:44 +0000 (00:50 +0000)
ext/pgsql/pgsql.c

index 2fc44c5c702324671b985dea983ca3a3e7cf60f3..59281364eb9c35949a724cd888640906b903687b 100644 (file)
@@ -2679,12 +2679,12 @@ PHP_FUNCTION(pg_result_status)
 
        pgsql_result = pg_result->result;
        if (result_type == PGSQL_STATUS_LONG) {
-               RETURN_STRING(PQcmdStatus(pgsql_result), 1);
-       }
-       else if (result_type == PGSQL_STATUS_STRING) {
                status = PQresultStatus(pgsql_result);
                RETURN_LONG((int)status);
        }
+       else if (result_type == PGSQL_STATUS_STRING) {
+               RETURN_STRING(PQcmdStatus(pgsql_result), 1);
+       }
        else {
                php_error(E_WARNING, "%s() expects optional 2nd parameter to be PGSQL_STATUS_LONG or PGSQL_STATUS_STRING",
                                  get_active_function_name(TSRMLS_C));