Lines Matching refs:pg_result

227 static void pgsql_result_free(pgsql_result_handle *pg_result)  in pgsql_result_free()  argument
229 PQclear(pg_result->result); in pgsql_result_free()
230 pg_result->result = NULL; in pgsql_result_free()
235 pgsql_result_handle *pg_result = pgsql_result_from_obj(obj); in pgsql_result_free_obj() local
237 if (pg_result->result) { in pgsql_result_free_obj()
238 pgsql_result_free(pg_result); in pgsql_result_free_obj()
241 zend_object_std_dtor(&pg_result->std); in pgsql_result_free_obj()
546 PGresult *pg_result; in php_pgsql_do_connect() local
600 PGresult *pg_result; in php_pgsql_do_connect() local
601 pg_result = PQexec(le->ptr, "select 1"); in php_pgsql_do_connect()
602 PQclear(pg_result); in php_pgsql_do_connect()
620 pg_result = PQexec(pgsql, "RESET ALL;"); in php_pgsql_do_connect()
621 PQclear(pg_result); in php_pgsql_do_connect()
1030 pgsql_result_handle *pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION() local
1031 pg_result->conn = pgsql; in PHP_FUNCTION()
1032 pg_result->result = pgsql_result; in PHP_FUNCTION()
1033 pg_result->row = 0; in PHP_FUNCTION()
1069 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1151 pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION()
1152 pg_result->conn = pgsql; in PHP_FUNCTION()
1153 pg_result->result = pgsql_result; in PHP_FUNCTION()
1154 pg_result->row = 0; in PHP_FUNCTION()
1174 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1229 pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION()
1230 pg_result->conn = pgsql; in PHP_FUNCTION()
1231 pg_result->result = pgsql_result; in PHP_FUNCTION()
1232 pg_result->row = 0; in PHP_FUNCTION()
1255 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1336 pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION()
1337 pg_result->conn = pgsql; in PHP_FUNCTION()
1338 pg_result->result = pgsql_result; in PHP_FUNCTION()
1339 pg_result->row = 0; in PHP_FUNCTION()
1357 pgsql_result_handle *pg_result; in php_pgsql_get_result_info() local
1363 pg_result = Z_PGSQL_RESULT_P(result); in php_pgsql_get_result_info()
1364 CHECK_PGSQL_RESULT(pg_result); in php_pgsql_get_result_info()
1365 pgsql_result = pg_result->result; in php_pgsql_get_result_info()
1504 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1512 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
1513 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
1520 if (fnum >= PQnfields(pg_result->result)) { in PHP_FUNCTION()
1525 Oid oid = PQftable(pg_result->result, (int)fnum); in PHP_FUNCTION()
1545 PGresult *tmp_res = PQexec(pg_result->conn, ZSTR_VAL(querystr.s)); in PHP_FUNCTION()
1579 pgsql_result_handle *pg_result; in php_pgsql_get_field_info() local
1586 pg_result = Z_PGSQL_RESULT_P(result); in php_pgsql_get_field_info()
1587 CHECK_PGSQL_RESULT(pg_result); in php_pgsql_get_field_info()
1594 pgsql_result = pg_result->result; in php_pgsql_get_field_info()
1609 RETURN_STR(get_field_name(pg_result->conn, PQftype(pgsql_result, (int)field))); in php_pgsql_get_field_info()
1656 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1662 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
1663 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
1664 pgsql_result = pg_result->result; in PHP_FUNCTION()
1700 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1716 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
1717 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
1718 pgsql_result = pg_result->result; in PHP_FUNCTION()
1721 if (pg_result->row < 0) { in PHP_FUNCTION()
1722 pg_result->row = 0; in PHP_FUNCTION()
1724 pgsql_row = pg_result->row; in PHP_FUNCTION()
1728 pg_result->row++; in PHP_FUNCTION()
1761 pgsql_result_handle *pg_result; in php_pgsql_fetch_hash() local
1793 pg_result = Z_PGSQL_RESULT_P(result); in php_pgsql_fetch_hash()
1794 CHECK_PGSQL_RESULT(pg_result); in php_pgsql_fetch_hash()
1795 pgsql_result = pg_result->result; in php_pgsql_fetch_hash()
1804 pg_result->row = pgsql_row; in php_pgsql_fetch_hash()
1807 pgsql_row = pg_result->row; in php_pgsql_fetch_hash()
1811 pg_result->row++; in php_pgsql_fetch_hash()
1933 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1944 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
1945 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
1946 pgsql_result = pg_result->result; in PHP_FUNCTION()
1958 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1967 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
1968 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
1975 pgsql_result = pg_result->result; in PHP_FUNCTION()
2004 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2010 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
2011 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
2013 if (row < 0 || row >= PQntuples(pg_result->result)) { in PHP_FUNCTION()
2018 pg_result->row = (int)row; in PHP_FUNCTION()
2033 pgsql_result_handle *pg_result; in php_pgsql_data_info() local
2049 pg_result = Z_PGSQL_RESULT_P(result); in php_pgsql_data_info()
2050 CHECK_PGSQL_RESULT(pg_result); in php_pgsql_data_info()
2051 pgsql_result = pg_result->result; in php_pgsql_data_info()
2054 if (pg_result->row < 0) { in php_pgsql_data_info()
2055 pg_result->row = 0; in php_pgsql_data_info()
2057 pgsql_row = pg_result->row; in php_pgsql_data_info()
2109 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2115 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
2116 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
2118 pgsql_result_free(pg_result); in PHP_FUNCTION()
2128 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2135 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
2136 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
2137 pgsql_result = pg_result->result; in PHP_FUNCTION()
3338 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
3345 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
3346 pgsql_result = pg_result->result; in PHP_FUNCTION()
3362 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
3369 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
3370 pgsql_result = pg_result->result; in PHP_FUNCTION()
3888 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
3905 pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION()
3906 pg_result->conn = pgsql; in PHP_FUNCTION()
3907 pg_result->result = pgsql_result; in PHP_FUNCTION()
3908 pg_result->row = 0; in PHP_FUNCTION()
3919 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
3925 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
3926 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
3927 pgsql_result = pg_result->result; in PHP_FUNCTION()
4161 PGresult *pg_result; in php_pgsql_meta_data() local
4223 pg_result = PQexec(pg_link, ZSTR_VAL(querystr.s)); in php_pgsql_meta_data()
4224 if (PQresultStatus(pg_result) != PGRES_TUPLES_OK || (num_rows = PQntuples(pg_result)) == 0) { in php_pgsql_meta_data()
4227 PQclear(pg_result); in php_pgsql_meta_data()
4236 add_assoc_long_ex(&elem, "num", sizeof("num") - 1, atoi(PQgetvalue(pg_result, i, 1))); in php_pgsql_meta_data()
4238 add_assoc_string_ex(&elem, "type", sizeof("type") - 1, PQgetvalue(pg_result, i, 2)); in php_pgsql_meta_data()
4240 add_assoc_long_ex(&elem, "len", sizeof("len") - 1, atoi(PQgetvalue(pg_result,i,3))); in php_pgsql_meta_data()
4242 …add_assoc_bool_ex(&elem, "not null", sizeof("not null") - 1, !strcmp(PQgetvalue(pg_result, i, 4), … in php_pgsql_meta_data()
4244 …add_assoc_bool_ex(&elem, "has default", sizeof("has default") - 1, !strcmp(PQgetvalue(pg_result,i,… in php_pgsql_meta_data()
4246 …add_assoc_long_ex(&elem, "array dims", sizeof("array dims") - 1, atoi(PQgetvalue(pg_result, i, 6))… in php_pgsql_meta_data()
4248 …add_assoc_bool_ex(&elem, "is enum", sizeof("is enum") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "e… in php_pgsql_meta_data()
4251 …add_assoc_bool_ex(&elem, "is base", sizeof("is base") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "b… in php_pgsql_meta_data()
4252 …l_ex(&elem, "is composite", sizeof("is composite") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "c")); in php_pgsql_meta_data()
4253 …add_assoc_bool_ex(&elem, "is pseudo", sizeof("is pseudo") - 1, !strcmp(PQgetvalue(pg_result, i, 7)… in php_pgsql_meta_data()
4255 … add_assoc_string_ex(&elem, "description", sizeof("description") - 1, PQgetvalue(pg_result, i, 8)); in php_pgsql_meta_data()
4258 name = PQgetvalue(pg_result,i,0); in php_pgsql_meta_data()
4261 PQclear(pg_result); in php_pgsql_meta_data()
5162 PGresult *pg_result; in do_exec() local
5164 pg_result = PQexec(pg_link, ZSTR_VAL(querystr->s)); in do_exec()
5165 if (PQresultStatus(pg_result) == expect) { in do_exec()
5166 PQclear(pg_result); in do_exec()
5169 php_error_docref(NULL, E_WARNING, "%s", PQresultErrorMessage(pg_result)); in do_exec()
5170 PQclear(pg_result); in do_exec()
5330 PGresult *pg_result; in PHP_FUNCTION() local
5365 pg_result = PQexec(pg_link, ZSTR_VAL(sql)); in PHP_FUNCTION()
5367 PQclear(pg_result); in PHP_FUNCTION()
5369 pg_result = PQexec(pg_link, ZSTR_VAL(sql)); in PHP_FUNCTION()
5373 if (pg_result) { in PHP_FUNCTION()
5374 status = PQresultStatus(pg_result); in PHP_FUNCTION()
5385 PQclear(pg_result); in PHP_FUNCTION()
5390 if (pg_result) { in PHP_FUNCTION()
5394 pg_res->result = pg_result; in PHP_FUNCTION()
5398 PQclear(pg_result); in PHP_FUNCTION()
5685 PHP_PGSQL_API void php_pgsql_result2array(PGresult *pg_result, zval *ret_array, long result_type) in php_pgsql_result2array() argument
5695 pg_numrows = PQntuples(pg_result); in php_pgsql_result2array()
5698 for (i = 0, num_fields = PQnfields(pg_result); i < num_fields; i++) { in php_pgsql_result2array()
5699 field_name = PQfname(pg_result, i); in php_pgsql_result2array()
5700 if (PQgetisnull(pg_result, pg_row, i)) { in php_pgsql_result2array()
5708 char *element = PQgetvalue(pg_result, pg_row, i); in php_pgsql_result2array()
5731 PGresult *pg_result; in php_pgsql_select() local
5762 pg_result = PQexec(pg_link, ZSTR_VAL(querystr.s)); in php_pgsql_select()
5763 if (PQresultStatus(pg_result) == PGRES_TUPLES_OK) { in php_pgsql_select()
5764 php_pgsql_result2array(pg_result, ret_array, result_type); in php_pgsql_select()
5769 PQclear(pg_result); in php_pgsql_select()