Lines Matching refs:pg_result
277 pgsql_result_handle *pg_result = (pgsql_result_handle *)rsrc->ptr; in _free_result() local
279 PQclear(pg_result->result); in _free_result()
280 efree(pg_result); in _free_result()
529 PGresult *pg_result; in php_pgsql_do_connect() local
583 PGresult *pg_result; in php_pgsql_do_connect() local
584 pg_result = PQexec(le->ptr, "select 1"); in php_pgsql_do_connect()
585 PQclear(pg_result); in php_pgsql_do_connect()
603 pg_result = PQexec(pgsql, "RESET ALL;"); in php_pgsql_do_connect()
604 PQclear(pg_result); in php_pgsql_do_connect()
1038 pgsql_result_handle *pg_result = (pgsql_result_handle *) emalloc(sizeof(pgsql_result_handle)); in PHP_FUNCTION() local
1039 pg_result->conn = pgsql; in PHP_FUNCTION()
1040 pg_result->result = pgsql_result; in PHP_FUNCTION()
1041 pg_result->row = 0; in PHP_FUNCTION()
1042 RETURN_RES(zend_register_resource(pg_result, le_result)); in PHP_FUNCTION()
1082 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1164 pg_result = (pgsql_result_handle *) emalloc(sizeof(pgsql_result_handle)); in PHP_FUNCTION()
1165 pg_result->conn = pgsql; in PHP_FUNCTION()
1166 pg_result->result = pgsql_result; in PHP_FUNCTION()
1167 pg_result->row = 0; in PHP_FUNCTION()
1168 RETURN_RES(zend_register_resource(pg_result, le_result)); in PHP_FUNCTION()
1190 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1245 pg_result = (pgsql_result_handle *) emalloc(sizeof(pgsql_result_handle)); 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()
1249 RETURN_RES(zend_register_resource(pg_result, le_result)); in PHP_FUNCTION()
1274 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1355 pg_result = (pgsql_result_handle *) emalloc(sizeof(pgsql_result_handle)); in PHP_FUNCTION()
1356 pg_result->conn = pgsql; in PHP_FUNCTION()
1357 pg_result->result = pgsql_result; in PHP_FUNCTION()
1358 pg_result->row = 0; in PHP_FUNCTION()
1359 RETURN_RES(zend_register_resource(pg_result, le_result)); in PHP_FUNCTION()
1378 pgsql_result_handle *pg_result; in php_pgsql_get_result_info() local
1384 …if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", … in php_pgsql_get_result_info()
1388 pgsql_result = pg_result->result; in php_pgsql_get_result_info()
1549 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1561 …if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", … in PHP_FUNCTION()
1570 if (fnum >= PQnfields(pg_result->result)) { in PHP_FUNCTION()
1575 oid = PQftable(pg_result->result, (int)fnum); in PHP_FUNCTION()
1602 …if ((tmp_res = PQexec(pg_result->conn, ZSTR_VAL(querystr.s))) == NULL || PQresultStatus(tmp_res) !… in PHP_FUNCTION()
1642 pgsql_result_handle *pg_result; in php_pgsql_get_field_info() local
1649 …if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", … in php_pgsql_get_field_info()
1658 pgsql_result = pg_result->result; in php_pgsql_get_field_info()
1673 …char *name = get_field_name(pg_result->conn, PQftype(pgsql_result, (int)field), &EG(regular_list)); in php_pgsql_get_field_info()
1723 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1729 …if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", … in PHP_FUNCTION()
1733 pgsql_result = pg_result->result; in PHP_FUNCTION()
1769 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1785 …if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", … in PHP_FUNCTION()
1789 pgsql_result = pg_result->result; in PHP_FUNCTION()
1791 if (pg_result->row < 0) { in PHP_FUNCTION()
1792 pg_result->row = 0; in PHP_FUNCTION()
1794 pgsql_row = pg_result->row; in PHP_FUNCTION()
1798 pg_result->row++; in PHP_FUNCTION()
1831 pgsql_result_handle *pg_result; in php_pgsql_fetch_hash() local
1863 …if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", … in php_pgsql_fetch_hash()
1867 pgsql_result = pg_result->result; in php_pgsql_fetch_hash()
1876 pg_result->row = pgsql_row; in php_pgsql_fetch_hash()
1879 pgsql_row = pg_result->row; in php_pgsql_fetch_hash()
1883 pg_result->row++; in php_pgsql_fetch_hash()
2005 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2016 …if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", … in PHP_FUNCTION()
2020 pgsql_result = pg_result->result; in PHP_FUNCTION()
2031 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2040 …if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", … in PHP_FUNCTION()
2049 pgsql_result = pg_result->result; in PHP_FUNCTION()
2078 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2084 …if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", … in PHP_FUNCTION()
2088 if (row < 0 || row >= PQntuples(pg_result->result)) { in PHP_FUNCTION()
2093 pg_result->row = (int)row; in PHP_FUNCTION()
2108 pgsql_result_handle *pg_result; in php_pgsql_data_info() local
2124 …if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", … in php_pgsql_data_info()
2128 pgsql_result = pg_result->result; in php_pgsql_data_info()
2130 if (pg_result->row < 0) { in php_pgsql_data_info()
2131 pg_result->row = 0; in php_pgsql_data_info()
2133 pgsql_row = pg_result->row; in php_pgsql_data_info()
2185 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2191 …if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", … in PHP_FUNCTION()
2205 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2212 …if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", … in PHP_FUNCTION()
2216 pgsql_result = pg_result->result; in PHP_FUNCTION()
3437 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
3444 …if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", … in PHP_FUNCTION()
3448 pgsql_result = pg_result->result; in PHP_FUNCTION()
3463 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
3470 …if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", … in PHP_FUNCTION()
3474 pgsql_result = pg_result->result; in PHP_FUNCTION()
3982 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
3997 pg_result = (pgsql_result_handle *) emalloc(sizeof(pgsql_result_handle)); in PHP_FUNCTION()
3998 pg_result->conn = pgsql; in PHP_FUNCTION()
3999 pg_result->result = pgsql_result; in PHP_FUNCTION()
4000 pg_result->row = 0; in PHP_FUNCTION()
4001 RETURN_RES(zend_register_resource(pg_result, le_result)); in PHP_FUNCTION()
4012 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
4018 …if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", … in PHP_FUNCTION()
4022 pgsql_result = pg_result->result; in PHP_FUNCTION()
4249 PGresult *pg_result; in php_pgsql_meta_data() local
4311 pg_result = PQexec(pg_link, ZSTR_VAL(querystr.s)); in php_pgsql_meta_data()
4312 if (PQresultStatus(pg_result) != PGRES_TUPLES_OK || (num_rows = PQntuples(pg_result)) == 0) { in php_pgsql_meta_data()
4315 PQclear(pg_result); in php_pgsql_meta_data()
4324 add_assoc_long_ex(&elem, "num", sizeof("num") - 1, atoi(PQgetvalue(pg_result, i, 1))); in php_pgsql_meta_data()
4326 add_assoc_string_ex(&elem, "type", sizeof("type") - 1, PQgetvalue(pg_result, i, 2)); in php_pgsql_meta_data()
4328 add_assoc_long_ex(&elem, "len", sizeof("len") - 1, atoi(PQgetvalue(pg_result,i,3))); in php_pgsql_meta_data()
4330 …add_assoc_bool_ex(&elem, "not null", sizeof("not null") - 1, !strcmp(PQgetvalue(pg_result, i, 4), … in php_pgsql_meta_data()
4332 …add_assoc_bool_ex(&elem, "has default", sizeof("has default") - 1, !strcmp(PQgetvalue(pg_result,i,… in php_pgsql_meta_data()
4334 …add_assoc_long_ex(&elem, "array dims", sizeof("array dims") - 1, atoi(PQgetvalue(pg_result, i, 6))… in php_pgsql_meta_data()
4336 …add_assoc_bool_ex(&elem, "is enum", sizeof("is enum") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "e… in php_pgsql_meta_data()
4339 …add_assoc_bool_ex(&elem, "is base", sizeof("is base") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "b… in php_pgsql_meta_data()
4340 …l_ex(&elem, "is composite", sizeof("is composite") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "c")); in php_pgsql_meta_data()
4341 …add_assoc_bool_ex(&elem, "is pesudo", sizeof("is pesudo") - 1, !strcmp(PQgetvalue(pg_result, i, 7)… in php_pgsql_meta_data()
4343 … add_assoc_string_ex(&elem, "description", sizeof("description") - 1, PQgetvalue(pg_result, i, 8)); in php_pgsql_meta_data()
4346 name = PQgetvalue(pg_result,i,0); in php_pgsql_meta_data()
4349 PQclear(pg_result); in php_pgsql_meta_data()
5277 PGresult *pg_result; in do_exec() local
5279 pg_result = PQexec(pg_link, ZSTR_VAL(querystr->s)); in do_exec()
5280 if (PQresultStatus(pg_result) == expect) { in do_exec()
5281 PQclear(pg_result); in do_exec()
5284 php_error_docref(NULL, E_WARNING, "%s", PQresultErrorMessage(pg_result)); in do_exec()
5285 PQclear(pg_result); in do_exec()
5446 PGresult *pg_result; in PHP_FUNCTION() local
5480 pg_result = PQexec(pg_link, ZSTR_VAL(sql)); in PHP_FUNCTION()
5482 PQclear(pg_result); in PHP_FUNCTION()
5484 pg_result = PQexec(pg_link, ZSTR_VAL(sql)); in PHP_FUNCTION()
5488 if (pg_result) { in PHP_FUNCTION()
5489 status = PQresultStatus(pg_result); in PHP_FUNCTION()
5500 PQclear(pg_result); in PHP_FUNCTION()
5505 if (pg_result) { in PHP_FUNCTION()
5508 pgsql_handle->result = pg_result; in PHP_FUNCTION()
5512 PQclear(pg_result); in PHP_FUNCTION()
5796 PHP_PGSQL_API void php_pgsql_result2array(PGresult *pg_result, zval *ret_array, long result_type) in php_pgsql_result2array() argument
5805 pg_numrows = PQntuples(pg_result); in php_pgsql_result2array()
5808 for (i = 0, num_fields = PQnfields(pg_result); i < num_fields; i++) { in php_pgsql_result2array()
5809 field_name = PQfname(pg_result, i); in php_pgsql_result2array()
5810 if (PQgetisnull(pg_result, pg_row, i)) { in php_pgsql_result2array()
5818 char *element = PQgetvalue(pg_result, pg_row, i); in php_pgsql_result2array()
5841 PGresult *pg_result; in php_pgsql_select() local
5872 pg_result = PQexec(pg_link, ZSTR_VAL(querystr.s)); in php_pgsql_select()
5873 if (PQresultStatus(pg_result) == PGRES_TUPLES_OK) { in php_pgsql_select()
5874 php_pgsql_result2array(pg_result, ret_array, result_type); in php_pgsql_select()
5879 PQclear(pg_result); in php_pgsql_select()