Lines Matching refs:result
112 ZEND_ARG_INFO(0, result)
117 ZEND_ARG_INFO(0, result)
918 odbc_result *result; in php_odbc_fetch_attribs() local
927 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in php_odbc_fetch_attribs()
929 result->longreadlen = flag; in php_odbc_fetch_attribs()
931 result->binmode = flag; in php_odbc_fetch_attribs()
945 int odbc_bindcols(odbc_result *result TSRMLS_DC) in odbc_bindcols()
956 result->values = (odbc_result_value *) safe_emalloc(sizeof(odbc_result_value), result->numcols, 0); in odbc_bindcols()
958 result->longreadlen = ODBCG(defaultlrl); in odbc_bindcols()
959 result->binmode = ODBCG(defaultbinmode); in odbc_bindcols()
961 for(i = 0; i < result->numcols; i++) { in odbc_bindcols()
962 rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_NAME, in odbc_bindcols()
963 result->values[i].name, sizeof(result->values[i].name), &colnamelen, 0); in odbc_bindcols()
964 rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_TYPE, in odbc_bindcols()
965 NULL, 0, NULL, &result->values[i].coltype); in odbc_bindcols()
971 switch(result->values[i].coltype) { in odbc_bindcols()
979 result->values[i].value = NULL; in odbc_bindcols()
984 result->values[i].value = (char *)emalloc(27); in odbc_bindcols()
985 SQLBindCol(result->stmt, (SQLUSMALLINT)(i+1), SQL_C_CHAR, result->values[i].value, in odbc_bindcols()
986 27, &result->values[i].vallen); in odbc_bindcols()
999 rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), colfieldid, in odbc_bindcols()
1002 if (result->values[i].coltype == SQL_TIMESTAMP) { in odbc_bindcols()
1010 result->values[i].value = (char *)emalloc(displaysize + 1); in odbc_bindcols()
1011 rc = SQLBindCol(result->stmt, (SQLUSMALLINT)(i+1), SQL_C_CHAR, result->values[i].value, in odbc_bindcols()
1012 displaysize + 1, &result->values[i].vallen); in odbc_bindcols()
1057 odbc_result *result; in odbc_column_lengths() local
1076 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in odbc_column_lengths()
1078 if (result->numcols == 0) { in odbc_column_lengths()
1083 if (pv_num > result->numcols) { in odbc_column_lengths()
1093 …SQLColAttributes(result->stmt, (SQLUSMALLINT)pv_num, (SQLUSMALLINT) (type?SQL_COLUMN_SCALE:SQL_COL… in odbc_column_lengths()
1166 odbc_result *result = NULL; in PHP_FUNCTION() local
1179 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
1181 result->numparams = 0; in PHP_FUNCTION()
1183 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
1185 efree(result); in PHP_FUNCTION()
1192 efree(result); in PHP_FUNCTION()
1201 if ((result->fetch_abs = (scrollopts & SQL_FD_FETCH_ABSOLUTE))) { in PHP_FUNCTION()
1205 SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, ODBCG(default_cursortype)); in PHP_FUNCTION()
1208 result->fetch_abs = 0; in PHP_FUNCTION()
1212 rc = SQLPrepare(result->stmt, query, SQL_NTS); in PHP_FUNCTION()
1217 odbc_sql_error(conn, result->stmt, "SQLPrepare"); in PHP_FUNCTION()
1220 odbc_sql_error(conn, result->stmt, "SQLPrepare"); in PHP_FUNCTION()
1224 SQLNumParams(result->stmt, &(result->numparams)); in PHP_FUNCTION()
1225 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1227 if (result->numcols > 0) { in PHP_FUNCTION()
1228 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
1229 efree(result); in PHP_FUNCTION()
1233 result->values = NULL; in PHP_FUNCTION()
1236 result->conn_ptr = conn; in PHP_FUNCTION()
1237 result->fetched = 0; in PHP_FUNCTION()
1238 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
1261 odbc_result *result; in PHP_FUNCTION() local
1271 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
1274 if (result->numparams > 0 && numArgs == 1) { in PHP_FUNCTION()
1279 if (result->numparams > 0) { in PHP_FUNCTION()
1280 if ((ne = zend_hash_num_elements(Z_ARRVAL_P(pv_param_arr))) < result->numparams) { in PHP_FUNCTION()
1281 …(NULL TSRMLS_CC, E_WARNING,"Not enough parameters (%d should be %d) given", ne, result->numparams); in PHP_FUNCTION()
1286 params = (params_t *)safe_emalloc(sizeof(params_t), result->numparams, 0); in PHP_FUNCTION()
1287 for(i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1291 for(i = 1; i <= result->numparams; i++) { in PHP_FUNCTION()
1294 SQLFreeStmt(result->stmt,SQL_RESET_PARAMS); in PHP_FUNCTION()
1295 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1308 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1309 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1318 rc = SQLDescribeParam(result->stmt, (SQLUSMALLINT)i, &sqltype, &precision, &scale, &nullable); in PHP_FUNCTION()
1322 odbc_sql_error(result->conn_ptr, result->stmt, "SQLDescribeParameter"); in PHP_FUNCTION()
1323 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1324 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1352 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1353 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1364 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1365 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1379 rc = SQLBindParameter(result->stmt, (SQLUSMALLINT)i, SQL_PARAM_INPUT, in PHP_FUNCTION()
1391 rc = SQLBindParameter(result->stmt, (SQLUSMALLINT)i, SQL_PARAM_INPUT, in PHP_FUNCTION()
1397 odbc_sql_error(result->conn_ptr, result->stmt, "SQLBindParameter"); in PHP_FUNCTION()
1398 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1399 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1411 rc = SQLFreeStmt(result->stmt, SQL_CLOSE); in PHP_FUNCTION()
1414 odbc_sql_error(result->conn_ptr, result->stmt, "SQLFreeStmt"); in PHP_FUNCTION()
1417 rc = SQLExecute(result->stmt); in PHP_FUNCTION()
1419 result->fetched = 0; in PHP_FUNCTION()
1424 rc = SQLParamData(result->stmt, (void*)&fp); in PHP_FUNCTION()
1427 SQLPutData(result->stmt, (void*)&buf, nbytes); in PHP_FUNCTION()
1437 odbc_sql_error(result->conn_ptr, result->stmt, "SQLExecute"); in PHP_FUNCTION()
1440 odbc_sql_error(result->conn_ptr, result->stmt, "SQLExecute"); in PHP_FUNCTION()
1445 if (result->numparams > 0) { in PHP_FUNCTION()
1446 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1447 for(i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1459 if (result->numcols == 0) { in PHP_FUNCTION()
1460 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1462 if (result->numcols > 0) { in PHP_FUNCTION()
1463 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
1464 efree(result); in PHP_FUNCTION()
1468 result->values = NULL; in PHP_FUNCTION()
1482 odbc_result *result; in PHP_FUNCTION() local
1489 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
1491 …rc = SQLGetInfo(result->conn_ptr->hdbc,SQL_MAX_CURSOR_NAME_LEN, (void *)&max_len,sizeof(max_len),&… in PHP_FUNCTION()
1498 rc = SQLGetCursorName(result->stmt,cursorname,(SQLSMALLINT)max_len,&len); in PHP_FUNCTION()
1505 SQLError( result->conn_ptr->henv, result->conn_ptr->hdbc, in PHP_FUNCTION()
1506 result->stmt, state, &error, errormsg, in PHP_FUNCTION()
1509 snprintf(cursorname, max_len+1, "php_curs_%d", (int)result->stmt); in PHP_FUNCTION()
1510 if (SQLSetCursorName(result->stmt,cursorname,SQL_NTS) != SQL_SUCCESS) { in PHP_FUNCTION()
1511 odbc_sql_error(result->conn_ptr, result->stmt, "SQLSetCursorName"); in PHP_FUNCTION()
1594 odbc_result *result = NULL; in PHP_FUNCTION() local
1609 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
1611 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
1614 efree(result); in PHP_FUNCTION()
1620 efree(result); in PHP_FUNCTION()
1629 if ((result->fetch_abs = (scrollopts & SQL_FD_FETCH_ABSOLUTE))) { in PHP_FUNCTION()
1633 SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, ODBCG(default_cursortype)); in PHP_FUNCTION()
1636 result->fetch_abs = 0; in PHP_FUNCTION()
1640 rc = SQLExecDirect(result->stmt, query, SQL_NTS); in PHP_FUNCTION()
1645 odbc_sql_error(conn, result->stmt, "SQLExecDirect"); in PHP_FUNCTION()
1646 SQLFreeStmt(result->stmt, SQL_DROP); in PHP_FUNCTION()
1647 efree(result); in PHP_FUNCTION()
1651 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1654 if (result->numcols > 0) { in PHP_FUNCTION()
1655 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
1656 efree(result); in PHP_FUNCTION()
1660 result->values = NULL; in PHP_FUNCTION()
1663 result->conn_ptr = conn; in PHP_FUNCTION()
1664 result->fetched = 0; in PHP_FUNCTION()
1665 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
1677 odbc_result *result; in php_odbc_fetch_hash() local
1701 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in php_odbc_fetch_hash()
1703 if (result->numcols == 0) { in php_odbc_fetch_hash()
1709 if (result->fetch_abs) { in php_odbc_fetch_hash()
1711 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in php_odbc_fetch_hash()
1713 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in php_odbc_fetch_hash()
1717 rc = SQLFetch(result->stmt); in php_odbc_fetch_hash()
1726 if (rownum > 0 && result->fetch_abs) in php_odbc_fetch_hash()
1727 result->fetched = rownum; in php_odbc_fetch_hash()
1730 result->fetched++; in php_odbc_fetch_hash()
1732 for(i = 0; i < result->numcols; i++) { in php_odbc_fetch_hash()
1738 switch(result->values[i].coltype) { in php_odbc_fetch_hash()
1742 if (result->binmode <= 0) { in php_odbc_fetch_hash()
1746 if (result->binmode == 1) { in php_odbc_fetch_hash()
1753 if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { in php_odbc_fetch_hash()
1758 buf = emalloc(result->longreadlen + 1); in php_odbc_fetch_hash()
1761 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1), sql_c_type, buf, result->longreadlen + 1, &re… in php_odbc_fetch_hash()
1764 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in php_odbc_fetch_hash()
1770 Z_STRLEN_P(tmp) = result->longreadlen; in php_odbc_fetch_hash()
1771 } else if (result->values[i].vallen == SQL_NULL_DATA) { in php_odbc_fetch_hash()
1775 Z_STRLEN_P(tmp) = result->values[i].vallen; in php_odbc_fetch_hash()
1781 if (result->values[i].vallen == SQL_NULL_DATA) { in php_odbc_fetch_hash()
1785 Z_STRLEN_P(tmp) = result->values[i].vallen; in php_odbc_fetch_hash()
1786 Z_STRVAL_P(tmp) = estrndup(result->values[i].value,Z_STRLEN_P(tmp)); in php_odbc_fetch_hash()
1793 if (!*(result->values[i].name) && Z_TYPE_P(tmp) == IS_STRING) { in php_odbc_fetch_hash()
1796 …zend_hash_update(Z_ARRVAL_P(return_value), result->values[i].name, strlen(result->values[i].name)+… in php_odbc_fetch_hash()
1832 odbc_result *result; in PHP_FUNCTION() local
1856 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
1858 if (result->numcols == 0) { in PHP_FUNCTION()
1868 if (result->fetch_abs) { in PHP_FUNCTION()
1870 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in PHP_FUNCTION()
1872 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
1876 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
1883 if (rownum > 0 && result->fetch_abs) in PHP_FUNCTION()
1884 result->fetched = rownum; in PHP_FUNCTION()
1887 result->fetched++; in PHP_FUNCTION()
1889 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
1895 switch(result->values[i].coltype) { in PHP_FUNCTION()
1899 if (result->binmode <= 0) { in PHP_FUNCTION()
1903 if (result->binmode == 1) sql_c_type = SQL_C_BINARY; in PHP_FUNCTION()
1909 if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { in PHP_FUNCTION()
1915 buf = emalloc(result->longreadlen + 1); in PHP_FUNCTION()
1917 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1),sql_c_type, buf, result->longreadlen + 1, &res… in PHP_FUNCTION()
1920 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
1925 Z_STRLEN_P(tmp) = result->longreadlen; in PHP_FUNCTION()
1926 } else if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
1930 Z_STRLEN_P(tmp) = result->values[i].vallen; in PHP_FUNCTION()
1936 if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
1940 Z_STRLEN_P(tmp) = result->values[i].vallen; in PHP_FUNCTION()
1941 Z_STRVAL_P(tmp) = estrndup(result->values[i].value,Z_STRLEN_P(tmp)); in PHP_FUNCTION()
1947 RETURN_LONG(result->numcols); in PHP_FUNCTION()
1956 odbc_result *result; in PHP_FUNCTION() local
1964 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
1965 if (result->numcols == 0) { in PHP_FUNCTION()
1969 rc = SQLFetchPrev(result->stmt); in PHP_FUNCTION()
1975 if (result->fetched > 1) { in PHP_FUNCTION()
1976 result->fetched--; in PHP_FUNCTION()
1989 odbc_result *result; in PHP_FUNCTION() local
2004 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2006 if (result->numcols == 0) { in PHP_FUNCTION()
2012 if (result->fetch_abs) { in PHP_FUNCTION()
2014 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in PHP_FUNCTION()
2016 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2020 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2027 result->fetched = rownum; in PHP_FUNCTION()
2029 result->fetched++; in PHP_FUNCTION()
2043 odbc_result *result; in PHP_FUNCTION() local
2067 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2069 if ((result->numcols == 0)) { in PHP_FUNCTION()
2076 if (result->values == NULL) { in PHP_FUNCTION()
2081 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2082 if (!strcasecmp(result->values[i].name, field)) { in PHP_FUNCTION()
2094 if (field_ind >= result->numcols || field_ind < 0) { in PHP_FUNCTION()
2100 if (result->fetched == 0) { in PHP_FUNCTION()
2103 if (result->fetch_abs) in PHP_FUNCTION()
2104 rc = SQLExtendedFetch(result->stmt, SQL_FETCH_NEXT, 1, &crow,RowStatus); in PHP_FUNCTION()
2107 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2113 result->fetched++; in PHP_FUNCTION()
2116 switch(result->values[field_ind].coltype) { in PHP_FUNCTION()
2120 if (result->binmode <= 1) { in PHP_FUNCTION()
2123 if (result->binmode <= 0) { in PHP_FUNCTION()
2130 if (IS_SQL_LONG(result->values[field_ind].coltype)) { in PHP_FUNCTION()
2131 if (result->longreadlen <= 0) { in PHP_FUNCTION()
2134 fieldsize = result->longreadlen; in PHP_FUNCTION()
2137 SQLColAttributes(result->stmt, (SQLUSMALLINT)(field_ind + 1), in PHP_FUNCTION()
2143 fieldsize = (result->longreadlen <= 0) ? 4096 : result->longreadlen; in PHP_FUNCTION()
2149 rc = SQLGetData(result->stmt, (SQLUSMALLINT)(field_ind + 1), sql_c_type, in PHP_FUNCTION()
2150 field, fieldsize, &result->values[field_ind].vallen); in PHP_FUNCTION()
2153 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2158 if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2167 if ((result->values[field_ind].coltype == SQL_LONGVARCHAR) in PHP_FUNCTION()
2169 || (result->values[field_ind].coltype == SQL_WLONGVARCHAR) in PHP_FUNCTION()
2177 …RETURN_STRINGL(field, (rc == SQL_SUCCESS_WITH_INFO) ? fieldsize : result->values[field_ind].vallen… in PHP_FUNCTION()
2181 if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2184 RETURN_STRINGL(result->values[field_ind].value, result->values[field_ind].vallen, 1); in PHP_FUNCTION()
2197 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(field_ind + 1),sql_c_type, field, fieldsize, &result-… in PHP_FUNCTION()
2200 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2205 if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2210 PHPWRITE(field,(rc == SQL_SUCCESS_WITH_INFO) ? 4095 : result->values[field_ind].vallen); in PHP_FUNCTION()
2226 odbc_result *result; in PHP_FUNCTION() local
2241 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2243 if (result->numcols == 0) { in PHP_FUNCTION()
2248 if (result->fetch_abs) in PHP_FUNCTION()
2249 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2252 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2266 for (i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2267 php_printf("<th>%s</th>", result->values[i].name); in PHP_FUNCTION()
2273 result->fetched++; in PHP_FUNCTION()
2275 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2277 switch(result->values[i].coltype) { in PHP_FUNCTION()
2281 if (result->binmode <= 0) { in PHP_FUNCTION()
2285 if (result->binmode <= 1) sql_c_type = SQL_C_BINARY; in PHP_FUNCTION()
2290 if (IS_SQL_LONG(result->values[i].coltype) && in PHP_FUNCTION()
2291 result->longreadlen <= 0) { in PHP_FUNCTION()
2297 buf = emalloc(result->longreadlen); in PHP_FUNCTION()
2300 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1),sql_c_type, buf, result->longreadlen, &result-… in PHP_FUNCTION()
2305 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2311 PHPWRITE(buf, result->longreadlen); in PHP_FUNCTION()
2312 } else if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2316 PHPWRITE(buf, result->values[i].vallen); in PHP_FUNCTION()
2321 if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2324 php_printf("<td>%s</td>", result->values[i].value); in PHP_FUNCTION()
2332 if (result->fetch_abs) in PHP_FUNCTION()
2333 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2336 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2340 RETURN_LONG(result->fetched); in PHP_FUNCTION()
2349 odbc_result *result; in PHP_FUNCTION() local
2356 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2357 if (result->values) { in PHP_FUNCTION()
2358 for (i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2359 if (result->values[i].value) { in PHP_FUNCTION()
2360 efree(result->values[i].value); in PHP_FUNCTION()
2363 efree(result->values); in PHP_FUNCTION()
2364 result->values = NULL; in PHP_FUNCTION()
2731 odbc_result *result; in PHP_FUNCTION() local
2738 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2739 SQLRowCount(result->stmt, &rows); in PHP_FUNCTION()
2749 odbc_result *result; in PHP_FUNCTION() local
2756 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2758 if (result->values) { in PHP_FUNCTION()
2759 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2760 if (result->values[i].value) { in PHP_FUNCTION()
2761 efree(result->values[i].value); in PHP_FUNCTION()
2764 efree(result->values); in PHP_FUNCTION()
2765 result->values = NULL; in PHP_FUNCTION()
2768 result->fetched = 0; in PHP_FUNCTION()
2769 rc = SQLMoreResults(result->stmt); in PHP_FUNCTION()
2771 rc = SQLFreeStmt(result->stmt, SQL_UNBIND); in PHP_FUNCTION()
2772 SQLNumParams(result->stmt, &(result->numparams)); in PHP_FUNCTION()
2773 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
2775 if (result->numcols > 0) { in PHP_FUNCTION()
2776 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
2777 efree(result); in PHP_FUNCTION()
2781 result->values = NULL; in PHP_FUNCTION()
2787 odbc_sql_error(result->conn_ptr, result->stmt, "SQLMoreResults"); in PHP_FUNCTION()
2798 odbc_result *result; in PHP_FUNCTION() local
2804 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2805 RETURN_LONG(result->numcols); in PHP_FUNCTION()
2813 odbc_result *result; in PHP_FUNCTION() local
2821 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2823 if (result->numcols == 0) { in PHP_FUNCTION()
2828 if (pv_num > result->numcols) { in PHP_FUNCTION()
2838 RETURN_STRING(result->values[pv_num - 1].name, 1); in PHP_FUNCTION()
2846 odbc_result *result; in PHP_FUNCTION() local
2856 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2858 if (result->numcols == 0) { in PHP_FUNCTION()
2863 if (pv_num > result->numcols) { in PHP_FUNCTION()
2873 SQLColAttributes(result->stmt, (SQLUSMALLINT)pv_num, SQL_COLUMN_TYPE_NAME, tmp, 31, &tmplen, NULL); in PHP_FUNCTION()
2900 odbc_result *result; in PHP_FUNCTION() local
2907 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2909 if (result->numcols == 0) { in PHP_FUNCTION()
2915 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2916 if (strcasecmp(result->values[i].name, fname) == 0) { in PHP_FUNCTION()
3045 odbc_result *result; in PHP_FUNCTION() local
3069 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_handle, -1, "ODBC result", le_result); in PHP_FUNCTION()
3071 rc = SQLSetStmtOption(result->stmt, (unsigned short) pv_opt, pv_val); in PHP_FUNCTION()
3074 odbc_sql_error(result->conn_ptr, result->stmt, "SetStmtOption"); in PHP_FUNCTION()
3097 odbc_result *result = NULL; in PHP_FUNCTION() local
3110 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3112 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3114 efree(result); in PHP_FUNCTION()
3121 efree(result); in PHP_FUNCTION()
3130 rc = SQLTables(result->stmt, in PHP_FUNCTION()
3138 efree(result); in PHP_FUNCTION()
3142 result->numparams = 0; in PHP_FUNCTION()
3143 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3145 if (result->numcols > 0) { in PHP_FUNCTION()
3146 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3147 efree(result); in PHP_FUNCTION()
3151 result->values = NULL; in PHP_FUNCTION()
3153 result->conn_ptr = conn; in PHP_FUNCTION()
3154 result->fetched = 0; in PHP_FUNCTION()
3155 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3164 odbc_result *result = NULL; in PHP_FUNCTION() local
3177 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3179 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3181 efree(result); in PHP_FUNCTION()
3188 efree(result); in PHP_FUNCTION()
3199 rc = SQLColumns(result->stmt, in PHP_FUNCTION()
3207 efree(result); in PHP_FUNCTION()
3211 result->numparams = 0; in PHP_FUNCTION()
3212 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3214 if (result->numcols > 0) { in PHP_FUNCTION()
3215 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3216 efree(result); in PHP_FUNCTION()
3220 result->values = NULL; in PHP_FUNCTION()
3222 result->conn_ptr = conn; in PHP_FUNCTION()
3223 result->fetched = 0; in PHP_FUNCTION()
3224 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3234 odbc_result *result = NULL; in PHP_FUNCTION() local
3247 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3249 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3251 efree(result); in PHP_FUNCTION()
3258 efree(result); in PHP_FUNCTION()
3262 rc = SQLColumnPrivileges(result->stmt, in PHP_FUNCTION()
3270 efree(result); in PHP_FUNCTION()
3274 result->numparams = 0; in PHP_FUNCTION()
3275 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3277 if (result->numcols > 0) { in PHP_FUNCTION()
3278 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3279 efree(result); in PHP_FUNCTION()
3283 result->values = NULL; in PHP_FUNCTION()
3285 result->conn_ptr = conn; in PHP_FUNCTION()
3286 result->fetched = 0; in PHP_FUNCTION()
3287 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3298 odbc_result *result = NULL; in PHP_FUNCTION() local
3323 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3325 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3327 efree(result); in PHP_FUNCTION()
3334 efree(result); in PHP_FUNCTION()
3338 rc = SQLForeignKeys(result->stmt, in PHP_FUNCTION()
3348 efree(result); in PHP_FUNCTION()
3352 result->numparams = 0; in PHP_FUNCTION()
3353 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3355 if (result->numcols > 0) { in PHP_FUNCTION()
3356 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3357 efree(result); in PHP_FUNCTION()
3361 result->values = NULL; in PHP_FUNCTION()
3363 result->conn_ptr = conn; in PHP_FUNCTION()
3364 result->fetched = 0; in PHP_FUNCTION()
3365 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3376 odbc_result *result = NULL; in PHP_FUNCTION() local
3389 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3391 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3393 efree(result); in PHP_FUNCTION()
3400 efree(result); in PHP_FUNCTION()
3404 rc = SQLGetTypeInfo(result->stmt, data_type ); in PHP_FUNCTION()
3408 efree(result); in PHP_FUNCTION()
3412 result->numparams = 0; in PHP_FUNCTION()
3413 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3415 if (result->numcols > 0) { in PHP_FUNCTION()
3416 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3417 efree(result); in PHP_FUNCTION()
3421 result->values = NULL; in PHP_FUNCTION()
3423 result->conn_ptr = conn; in PHP_FUNCTION()
3424 result->fetched = 0; in PHP_FUNCTION()
3425 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3434 odbc_result *result = NULL; in PHP_FUNCTION() local
3446 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3448 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3450 efree(result); in PHP_FUNCTION()
3457 efree(result); in PHP_FUNCTION()
3461 rc = SQLPrimaryKeys(result->stmt, in PHP_FUNCTION()
3468 efree(result); in PHP_FUNCTION()
3472 result->numparams = 0; in PHP_FUNCTION()
3473 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3475 if (result->numcols > 0) { in PHP_FUNCTION()
3476 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3477 efree(result); in PHP_FUNCTION()
3481 result->values = NULL; in PHP_FUNCTION()
3483 result->conn_ptr = conn; in PHP_FUNCTION()
3484 result->fetched = 0; in PHP_FUNCTION()
3485 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3495 odbc_result *result = NULL; in PHP_FUNCTION() local
3512 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3514 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3516 efree(result); in PHP_FUNCTION()
3523 efree(result); in PHP_FUNCTION()
3527 rc = SQLProcedureColumns(result->stmt, in PHP_FUNCTION()
3535 efree(result); in PHP_FUNCTION()
3539 result->numparams = 0; in PHP_FUNCTION()
3540 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3542 if (result->numcols > 0) { in PHP_FUNCTION()
3543 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3544 efree(result); in PHP_FUNCTION()
3548 result->values = NULL; in PHP_FUNCTION()
3550 result->conn_ptr = conn; in PHP_FUNCTION()
3551 result->fetched = 0; in PHP_FUNCTION()
3552 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3563 odbc_result *result = NULL; in PHP_FUNCTION() local
3579 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3581 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3583 efree(result); in PHP_FUNCTION()
3590 efree(result); in PHP_FUNCTION()
3594 rc = SQLProcedures(result->stmt, in PHP_FUNCTION()
3601 efree(result); in PHP_FUNCTION()
3605 result->numparams = 0; in PHP_FUNCTION()
3606 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3608 if (result->numcols > 0) { in PHP_FUNCTION()
3609 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3610 efree(result); in PHP_FUNCTION()
3614 result->values = NULL; in PHP_FUNCTION()
3616 result->conn_ptr = conn; in PHP_FUNCTION()
3617 result->fetched = 0; in PHP_FUNCTION()
3618 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3629 odbc_result *result = NULL; in PHP_FUNCTION() local
3647 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3649 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3651 efree(result); in PHP_FUNCTION()
3658 efree(result); in PHP_FUNCTION()
3662 rc = SQLSpecialColumns(result->stmt, in PHP_FUNCTION()
3672 efree(result); in PHP_FUNCTION()
3676 result->numparams = 0; in PHP_FUNCTION()
3677 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3679 if (result->numcols > 0) { in PHP_FUNCTION()
3680 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3681 efree(result); in PHP_FUNCTION()
3685 result->values = NULL; in PHP_FUNCTION()
3687 result->conn_ptr = conn; in PHP_FUNCTION()
3688 result->fetched = 0; in PHP_FUNCTION()
3689 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3699 odbc_result *result = NULL; in PHP_FUNCTION() local
3716 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3718 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3720 efree(result); in PHP_FUNCTION()
3727 efree(result); in PHP_FUNCTION()
3731 rc = SQLStatistics(result->stmt, in PHP_FUNCTION()
3740 efree(result); in PHP_FUNCTION()
3744 result->numparams = 0; in PHP_FUNCTION()
3745 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3747 if (result->numcols > 0) { in PHP_FUNCTION()
3748 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3749 efree(result); in PHP_FUNCTION()
3753 result->values = NULL; in PHP_FUNCTION()
3755 result->conn_ptr = conn; in PHP_FUNCTION()
3756 result->fetched = 0; in PHP_FUNCTION()
3757 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3767 odbc_result *result = NULL; in PHP_FUNCTION() local
3779 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3781 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3783 efree(result); in PHP_FUNCTION()
3790 efree(result); in PHP_FUNCTION()
3794 rc = SQLTablePrivileges(result->stmt, in PHP_FUNCTION()
3801 efree(result); in PHP_FUNCTION()
3805 result->numparams = 0; in PHP_FUNCTION()
3806 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3808 if (result->numcols > 0) { in PHP_FUNCTION()
3809 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3810 efree(result); in PHP_FUNCTION()
3814 result->values = NULL; in PHP_FUNCTION()
3816 result->conn_ptr = conn; in PHP_FUNCTION()
3817 result->fetched = 0; in PHP_FUNCTION()
3818 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()