Lines Matching refs:pg_result
224 static void pgsql_result_free(pgsql_result_handle *pg_result) in pgsql_result_free() argument
226 PQclear(pg_result->result); in pgsql_result_free()
227 pg_result->result = NULL; in pgsql_result_free()
232 pgsql_result_handle *pg_result = pgsql_result_from_obj(obj); in pgsql_result_free_obj() local
234 if (pg_result->result) { in pgsql_result_free_obj()
235 pgsql_result_free(pg_result); in pgsql_result_free_obj()
238 zend_object_std_dtor(&pg_result->std); in pgsql_result_free_obj()
638 PGresult *pg_result; in php_pgsql_do_connect() local
692 PGresult *pg_result; in php_pgsql_do_connect() local
693 pg_result = PQexec(le->ptr, "select 1"); in php_pgsql_do_connect()
694 PQclear(pg_result); in php_pgsql_do_connect()
712 pg_result = PQexec(pgsql, "RESET ALL;"); in php_pgsql_do_connect()
713 PQclear(pg_result); in php_pgsql_do_connect()
1124 pgsql_result_handle *pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION() local
1125 pg_result->conn = pgsql; in PHP_FUNCTION()
1126 pg_result->result = pgsql_result; in PHP_FUNCTION()
1127 pg_result->row = 0; in PHP_FUNCTION()
1163 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1245 pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION()
1246 pg_result->conn = pgsql; in PHP_FUNCTION()
1247 pg_result->result = pgsql_result; in PHP_FUNCTION()
1248 pg_result->row = 0; in PHP_FUNCTION()
1268 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1323 pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION()
1324 pg_result->conn = pgsql; in PHP_FUNCTION()
1325 pg_result->result = pgsql_result; in PHP_FUNCTION()
1326 pg_result->row = 0; in PHP_FUNCTION()
1349 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1430 pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION()
1431 pg_result->conn = pgsql; in PHP_FUNCTION()
1432 pg_result->result = pgsql_result; in PHP_FUNCTION()
1433 pg_result->row = 0; in PHP_FUNCTION()
1451 pgsql_result_handle *pg_result; in php_pgsql_get_result_info() local
1457 pg_result = Z_PGSQL_RESULT_P(result); in php_pgsql_get_result_info()
1458 CHECK_PGSQL_RESULT(pg_result); in php_pgsql_get_result_info()
1459 pgsql_result = pg_result->result; in php_pgsql_get_result_info()
1598 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1606 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
1607 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
1614 if (fnum >= PQnfields(pg_result->result)) { in PHP_FUNCTION()
1619 Oid oid = PQftable(pg_result->result, (int)fnum); in PHP_FUNCTION()
1639 PGresult *tmp_res = PQexec(pg_result->conn, ZSTR_VAL(querystr.s)); in PHP_FUNCTION()
1673 pgsql_result_handle *pg_result; in php_pgsql_get_field_info() local
1680 pg_result = Z_PGSQL_RESULT_P(result); in php_pgsql_get_field_info()
1681 CHECK_PGSQL_RESULT(pg_result); in php_pgsql_get_field_info()
1688 pgsql_result = pg_result->result; in php_pgsql_get_field_info()
1703 RETURN_STR(get_field_name(pg_result->conn, PQftype(pgsql_result, (int)field))); in php_pgsql_get_field_info()
1750 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1756 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
1757 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
1758 pgsql_result = pg_result->result; in PHP_FUNCTION()
1794 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1810 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
1811 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
1812 pgsql_result = pg_result->result; in PHP_FUNCTION()
1815 if (pg_result->row < 0) { in PHP_FUNCTION()
1816 pg_result->row = 0; in PHP_FUNCTION()
1818 pgsql_row = pg_result->row; in PHP_FUNCTION()
1822 pg_result->row++; in PHP_FUNCTION()
1855 pgsql_result_handle *pg_result; in php_pgsql_fetch_hash() local
1887 pg_result = Z_PGSQL_RESULT_P(result); in php_pgsql_fetch_hash()
1888 CHECK_PGSQL_RESULT(pg_result); in php_pgsql_fetch_hash()
1889 pgsql_result = pg_result->result; in php_pgsql_fetch_hash()
1898 pg_result->row = pgsql_row; in php_pgsql_fetch_hash()
1901 pgsql_row = pg_result->row; in php_pgsql_fetch_hash()
1905 pg_result->row++; in php_pgsql_fetch_hash()
2027 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2038 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
2039 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
2040 pgsql_result = pg_result->result; in PHP_FUNCTION()
2052 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2061 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
2062 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
2069 pgsql_result = pg_result->result; in PHP_FUNCTION()
2098 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2104 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
2105 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
2107 if (row < 0 || row >= PQntuples(pg_result->result)) { in PHP_FUNCTION()
2112 pg_result->row = (int)row; in PHP_FUNCTION()
2127 pgsql_result_handle *pg_result; in php_pgsql_data_info() local
2143 pg_result = Z_PGSQL_RESULT_P(result); in php_pgsql_data_info()
2144 CHECK_PGSQL_RESULT(pg_result); in php_pgsql_data_info()
2145 pgsql_result = pg_result->result; in php_pgsql_data_info()
2148 if (pg_result->row < 0) { in php_pgsql_data_info()
2149 pg_result->row = 0; in php_pgsql_data_info()
2151 pgsql_row = pg_result->row; in php_pgsql_data_info()
2203 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2209 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
2210 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
2212 pgsql_result_free(pg_result); in PHP_FUNCTION()
2222 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2229 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
2230 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
2231 pgsql_result = pg_result->result; in PHP_FUNCTION()
3432 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
3439 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
3440 pgsql_result = pg_result->result; in PHP_FUNCTION()
3456 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
3463 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
3464 pgsql_result = pg_result->result; in PHP_FUNCTION()
3982 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
3999 pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION()
4000 pg_result->conn = pgsql; in PHP_FUNCTION()
4001 pg_result->result = pgsql_result; in PHP_FUNCTION()
4002 pg_result->row = 0; in PHP_FUNCTION()
4013 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
4019 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
4020 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
4021 pgsql_result = pg_result->result; in PHP_FUNCTION()
4255 PGresult *pg_result; in php_pgsql_meta_data() local
4317 pg_result = PQexec(pg_link, ZSTR_VAL(querystr.s)); in php_pgsql_meta_data()
4318 if (PQresultStatus(pg_result) != PGRES_TUPLES_OK || (num_rows = PQntuples(pg_result)) == 0) { in php_pgsql_meta_data()
4321 PQclear(pg_result); in php_pgsql_meta_data()
4330 add_assoc_long_ex(&elem, "num", sizeof("num") - 1, atoi(PQgetvalue(pg_result, i, 1))); in php_pgsql_meta_data()
4332 add_assoc_string_ex(&elem, "type", sizeof("type") - 1, PQgetvalue(pg_result, i, 2)); in php_pgsql_meta_data()
4334 add_assoc_long_ex(&elem, "len", sizeof("len") - 1, atoi(PQgetvalue(pg_result,i,3))); in php_pgsql_meta_data()
4336 …add_assoc_bool_ex(&elem, "not null", sizeof("not null") - 1, !strcmp(PQgetvalue(pg_result, i, 4), … in php_pgsql_meta_data()
4338 …add_assoc_bool_ex(&elem, "has default", sizeof("has default") - 1, !strcmp(PQgetvalue(pg_result,i,… in php_pgsql_meta_data()
4340 …add_assoc_long_ex(&elem, "array dims", sizeof("array dims") - 1, atoi(PQgetvalue(pg_result, i, 6))… in php_pgsql_meta_data()
4342 …add_assoc_bool_ex(&elem, "is enum", sizeof("is enum") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "e… in php_pgsql_meta_data()
4345 …add_assoc_bool_ex(&elem, "is base", sizeof("is base") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "b… in php_pgsql_meta_data()
4346 …l_ex(&elem, "is composite", sizeof("is composite") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "c")); in php_pgsql_meta_data()
4347 …add_assoc_bool_ex(&elem, "is pseudo", sizeof("is pseudo") - 1, !strcmp(PQgetvalue(pg_result, i, 7)… in php_pgsql_meta_data()
4349 … add_assoc_string_ex(&elem, "description", sizeof("description") - 1, PQgetvalue(pg_result, i, 8)); in php_pgsql_meta_data()
4352 name = PQgetvalue(pg_result,i,0); in php_pgsql_meta_data()
4355 PQclear(pg_result); in php_pgsql_meta_data()
5256 PGresult *pg_result; in do_exec() local
5258 pg_result = PQexec(pg_link, ZSTR_VAL(querystr->s)); in do_exec()
5259 if (PQresultStatus(pg_result) == expect) { in do_exec()
5260 PQclear(pg_result); in do_exec()
5263 php_error_docref(NULL, E_WARNING, "%s", PQresultErrorMessage(pg_result)); in do_exec()
5264 PQclear(pg_result); in do_exec()
5424 PGresult *pg_result; in PHP_FUNCTION() local
5459 pg_result = PQexec(pg_link, ZSTR_VAL(sql)); in PHP_FUNCTION()
5461 PQclear(pg_result); in PHP_FUNCTION()
5463 pg_result = PQexec(pg_link, ZSTR_VAL(sql)); in PHP_FUNCTION()
5467 if (pg_result) { in PHP_FUNCTION()
5468 status = PQresultStatus(pg_result); in PHP_FUNCTION()
5479 PQclear(pg_result); in PHP_FUNCTION()
5484 if (pg_result) { in PHP_FUNCTION()
5488 pg_res->result = pg_result; in PHP_FUNCTION()
5492 PQclear(pg_result); in PHP_FUNCTION()
5779 PHP_PGSQL_API void php_pgsql_result2array(PGresult *pg_result, zval *ret_array, long result_type) in php_pgsql_result2array() argument
5789 pg_numrows = PQntuples(pg_result); in php_pgsql_result2array()
5792 for (i = 0, num_fields = PQnfields(pg_result); i < num_fields; i++) { in php_pgsql_result2array()
5793 field_name = PQfname(pg_result, i); in php_pgsql_result2array()
5794 if (PQgetisnull(pg_result, pg_row, i)) { in php_pgsql_result2array()
5802 char *element = PQgetvalue(pg_result, pg_row, i); in php_pgsql_result2array()
5825 PGresult *pg_result; in php_pgsql_select() local
5856 pg_result = PQexec(pg_link, ZSTR_VAL(querystr.s)); in php_pgsql_select()
5857 if (PQresultStatus(pg_result) == PGRES_TUPLES_OK) { in php_pgsql_select()
5858 php_pgsql_result2array(pg_result, ret_array, result_type); in php_pgsql_select()
5863 PQclear(pg_result); in php_pgsql_select()