Lines Matching refs:result
112 ZEND_ARG_INFO(0, result)
117 ZEND_ARG_INFO(0, result)
915 odbc_result *result; in php_odbc_fetch_attribs() local
924 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in php_odbc_fetch_attribs()
926 result->longreadlen = flag; in php_odbc_fetch_attribs()
928 result->binmode = flag; in php_odbc_fetch_attribs()
942 int odbc_bindcols(odbc_result *result TSRMLS_DC) in odbc_bindcols()
949 result->values = (odbc_result_value *) safe_emalloc(sizeof(odbc_result_value), result->numcols, 0); in odbc_bindcols()
951 result->longreadlen = ODBCG(defaultlrl); in odbc_bindcols()
952 result->binmode = ODBCG(defaultbinmode); in odbc_bindcols()
954 for(i = 0; i < result->numcols; i++) { in odbc_bindcols()
955 rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_NAME, in odbc_bindcols()
956 result->values[i].name, sizeof(result->values[i].name), &colnamelen, 0); in odbc_bindcols()
957 rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_TYPE, in odbc_bindcols()
958 NULL, 0, NULL, &result->values[i].coltype); in odbc_bindcols()
964 switch(result->values[i].coltype) { in odbc_bindcols()
969 result->values[i].value = NULL; in odbc_bindcols()
974 result->values[i].value = (char *)emalloc(27); in odbc_bindcols()
975 SQLBindCol(result->stmt, (SQLUSMALLINT)(i+1), SQL_C_CHAR, result->values[i].value, in odbc_bindcols()
976 27, &result->values[i].vallen); in odbc_bindcols()
980 rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_DISPLAY_SIZE, in odbc_bindcols()
982 displaysize = displaysize <= result->longreadlen ? displaysize : in odbc_bindcols()
983 result->longreadlen; in odbc_bindcols()
985 if (result->values[i].coltype == SQL_TIMESTAMP) { in odbc_bindcols()
988 result->values[i].value = (char *)emalloc(displaysize + 1); in odbc_bindcols()
989 rc = SQLBindCol(result->stmt, (SQLUSMALLINT)(i+1), SQL_C_CHAR, result->values[i].value, in odbc_bindcols()
990 displaysize + 1, &result->values[i].vallen); in odbc_bindcols()
1035 odbc_result *result; in odbc_column_lengths() local
1054 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in odbc_column_lengths()
1056 if (result->numcols == 0) { in odbc_column_lengths()
1061 if (pv_num > result->numcols) { in odbc_column_lengths()
1071 …SQLColAttributes(result->stmt, (SQLUSMALLINT)pv_num, (SQLUSMALLINT) (type?SQL_COLUMN_SCALE:SQL_COL… in odbc_column_lengths()
1144 odbc_result *result = NULL; in PHP_FUNCTION() local
1157 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
1159 result->numparams = 0; in PHP_FUNCTION()
1161 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
1163 efree(result); in PHP_FUNCTION()
1170 efree(result); in PHP_FUNCTION()
1179 if ((result->fetch_abs = (scrollopts & SQL_FD_FETCH_ABSOLUTE))) { in PHP_FUNCTION()
1183 SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, ODBCG(default_cursortype)); in PHP_FUNCTION()
1186 result->fetch_abs = 0; in PHP_FUNCTION()
1190 rc = SQLPrepare(result->stmt, query, SQL_NTS); in PHP_FUNCTION()
1195 odbc_sql_error(conn, result->stmt, "SQLPrepare"); in PHP_FUNCTION()
1198 odbc_sql_error(conn, result->stmt, "SQLPrepare"); in PHP_FUNCTION()
1202 SQLNumParams(result->stmt, &(result->numparams)); in PHP_FUNCTION()
1203 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1205 if (result->numcols > 0) { in PHP_FUNCTION()
1206 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
1207 efree(result); in PHP_FUNCTION()
1211 result->values = NULL; in PHP_FUNCTION()
1214 result->conn_ptr = conn; in PHP_FUNCTION()
1215 result->fetched = 0; in PHP_FUNCTION()
1216 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
1239 odbc_result *result; in PHP_FUNCTION() local
1249 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
1252 if (result->numparams > 0 && numArgs == 1) { in PHP_FUNCTION()
1257 if (result->numparams > 0) { in PHP_FUNCTION()
1258 if ((ne = zend_hash_num_elements(Z_ARRVAL_P(pv_param_arr))) < result->numparams) { in PHP_FUNCTION()
1259 …(NULL TSRMLS_CC, E_WARNING,"Not enough parameters (%d should be %d) given", ne, result->numparams); in PHP_FUNCTION()
1264 params = (params_t *)safe_emalloc(sizeof(params_t), result->numparams, 0); in PHP_FUNCTION()
1265 for(i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1269 for(i = 1; i <= result->numparams; i++) { in PHP_FUNCTION()
1272 SQLFreeStmt(result->stmt,SQL_RESET_PARAMS); in PHP_FUNCTION()
1273 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1286 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1287 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1296 rc = SQLDescribeParam(result->stmt, (SQLUSMALLINT)i, &sqltype, &precision, &scale, &nullable); in PHP_FUNCTION()
1300 odbc_sql_error(result->conn_ptr, result->stmt, "SQLDescribeParameter"); in PHP_FUNCTION()
1301 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1302 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1336 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1337 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1348 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1349 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1363 rc = SQLBindParameter(result->stmt, (SQLUSMALLINT)i, SQL_PARAM_INPUT, in PHP_FUNCTION()
1375 rc = SQLBindParameter(result->stmt, (SQLUSMALLINT)i, SQL_PARAM_INPUT, in PHP_FUNCTION()
1381 odbc_sql_error(result->conn_ptr, result->stmt, "SQLBindParameter"); in PHP_FUNCTION()
1382 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1383 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1395 rc = SQLFreeStmt(result->stmt, SQL_CLOSE); in PHP_FUNCTION()
1398 odbc_sql_error(result->conn_ptr, result->stmt, "SQLFreeStmt"); in PHP_FUNCTION()
1401 rc = SQLExecute(result->stmt); in PHP_FUNCTION()
1403 result->fetched = 0; in PHP_FUNCTION()
1408 rc = SQLParamData(result->stmt, (void*)&fp); in PHP_FUNCTION()
1411 SQLPutData(result->stmt, (void*)&buf, nbytes); in PHP_FUNCTION()
1421 odbc_sql_error(result->conn_ptr, result->stmt, "SQLExecute"); in PHP_FUNCTION()
1424 odbc_sql_error(result->conn_ptr, result->stmt, "SQLExecute"); in PHP_FUNCTION()
1429 if (result->numparams > 0) { in PHP_FUNCTION()
1430 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1431 for(i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1443 if (result->numcols == 0) { in PHP_FUNCTION()
1444 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1446 if (result->numcols > 0) { in PHP_FUNCTION()
1447 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
1448 efree(result); in PHP_FUNCTION()
1452 result->values = NULL; in PHP_FUNCTION()
1466 odbc_result *result; in PHP_FUNCTION() local
1473 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
1475 …rc = SQLGetInfo(result->conn_ptr->hdbc,SQL_MAX_CURSOR_NAME_LEN, (void *)&max_len,sizeof(max_len),&… in PHP_FUNCTION()
1482 rc = SQLGetCursorName(result->stmt,cursorname,(SQLSMALLINT)max_len,&len); in PHP_FUNCTION()
1489 SQLError( result->conn_ptr->henv, result->conn_ptr->hdbc, in PHP_FUNCTION()
1490 result->stmt, state, &error, errormsg, in PHP_FUNCTION()
1493 snprintf(cursorname, max_len+1, "php_curs_%d", (int)result->stmt); in PHP_FUNCTION()
1494 if (SQLSetCursorName(result->stmt,cursorname,SQL_NTS) != SQL_SUCCESS) { in PHP_FUNCTION()
1495 odbc_sql_error(result->conn_ptr, result->stmt, "SQLSetCursorName"); in PHP_FUNCTION()
1578 odbc_result *result = NULL; in PHP_FUNCTION() local
1593 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
1595 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
1598 efree(result); in PHP_FUNCTION()
1604 efree(result); in PHP_FUNCTION()
1613 if ((result->fetch_abs = (scrollopts & SQL_FD_FETCH_ABSOLUTE))) { in PHP_FUNCTION()
1617 SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, ODBCG(default_cursortype)); in PHP_FUNCTION()
1620 result->fetch_abs = 0; in PHP_FUNCTION()
1624 rc = SQLExecDirect(result->stmt, query, SQL_NTS); in PHP_FUNCTION()
1629 odbc_sql_error(conn, result->stmt, "SQLExecDirect"); in PHP_FUNCTION()
1630 SQLFreeStmt(result->stmt, SQL_DROP); in PHP_FUNCTION()
1631 efree(result); in PHP_FUNCTION()
1635 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1638 if (result->numcols > 0) { in PHP_FUNCTION()
1639 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
1640 efree(result); in PHP_FUNCTION()
1644 result->values = NULL; in PHP_FUNCTION()
1647 result->conn_ptr = conn; in PHP_FUNCTION()
1648 result->fetched = 0; in PHP_FUNCTION()
1649 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
1661 odbc_result *result; in php_odbc_fetch_hash() local
1685 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in php_odbc_fetch_hash()
1687 if (result->numcols == 0) { in php_odbc_fetch_hash()
1693 if (result->fetch_abs) { in php_odbc_fetch_hash()
1695 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in php_odbc_fetch_hash()
1697 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in php_odbc_fetch_hash()
1701 rc = SQLFetch(result->stmt); in php_odbc_fetch_hash()
1710 if (rownum > 0 && result->fetch_abs) in php_odbc_fetch_hash()
1711 result->fetched = rownum; in php_odbc_fetch_hash()
1714 result->fetched++; in php_odbc_fetch_hash()
1716 for(i = 0; i < result->numcols; i++) { in php_odbc_fetch_hash()
1722 switch(result->values[i].coltype) { in php_odbc_fetch_hash()
1726 if (result->binmode <= 0) { in php_odbc_fetch_hash()
1730 if (result->binmode == 1) { in php_odbc_fetch_hash()
1734 if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { in php_odbc_fetch_hash()
1739 buf = emalloc(result->longreadlen + 1); in php_odbc_fetch_hash()
1742 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1), sql_c_type, buf, result->longreadlen + 1, &re… in php_odbc_fetch_hash()
1745 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in php_odbc_fetch_hash()
1751 Z_STRLEN_P(tmp) = result->longreadlen; in php_odbc_fetch_hash()
1752 } else if (result->values[i].vallen == SQL_NULL_DATA) { in php_odbc_fetch_hash()
1756 Z_STRLEN_P(tmp) = result->values[i].vallen; in php_odbc_fetch_hash()
1762 if (result->values[i].vallen == SQL_NULL_DATA) { in php_odbc_fetch_hash()
1766 Z_STRLEN_P(tmp) = result->values[i].vallen; in php_odbc_fetch_hash()
1767 Z_STRVAL_P(tmp) = estrndup(result->values[i].value,Z_STRLEN_P(tmp)); in php_odbc_fetch_hash()
1774 if (!*(result->values[i].name)) { in php_odbc_fetch_hash()
1777 …zend_hash_update(Z_ARRVAL_P(return_value), result->values[i].name, strlen(result->values[i].name)+… in php_odbc_fetch_hash()
1813 odbc_result *result; in PHP_FUNCTION() local
1837 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
1839 if (result->numcols == 0) { in PHP_FUNCTION()
1849 if (result->fetch_abs) { in PHP_FUNCTION()
1851 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in PHP_FUNCTION()
1853 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
1857 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
1864 if (rownum > 0 && result->fetch_abs) in PHP_FUNCTION()
1865 result->fetched = rownum; in PHP_FUNCTION()
1868 result->fetched++; in PHP_FUNCTION()
1870 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
1876 switch(result->values[i].coltype) { in PHP_FUNCTION()
1880 if (result->binmode <= 0) { in PHP_FUNCTION()
1884 if (result->binmode == 1) sql_c_type = SQL_C_BINARY; in PHP_FUNCTION()
1886 if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { in PHP_FUNCTION()
1892 buf = emalloc(result->longreadlen + 1); in PHP_FUNCTION()
1894 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1),sql_c_type, buf, result->longreadlen + 1, &res… in PHP_FUNCTION()
1897 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
1902 Z_STRLEN_P(tmp) = result->longreadlen; in PHP_FUNCTION()
1903 } else if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
1907 Z_STRLEN_P(tmp) = result->values[i].vallen; in PHP_FUNCTION()
1913 if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
1917 Z_STRLEN_P(tmp) = result->values[i].vallen; in PHP_FUNCTION()
1918 Z_STRVAL_P(tmp) = estrndup(result->values[i].value,Z_STRLEN_P(tmp)); in PHP_FUNCTION()
1924 RETURN_LONG(result->numcols); in PHP_FUNCTION()
1933 odbc_result *result; in PHP_FUNCTION() local
1941 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
1942 if (result->numcols == 0) { in PHP_FUNCTION()
1946 rc = SQLFetchPrev(result->stmt); in PHP_FUNCTION()
1952 if (result->fetched > 1) { in PHP_FUNCTION()
1953 result->fetched--; in PHP_FUNCTION()
1966 odbc_result *result; in PHP_FUNCTION() local
1981 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
1983 if (result->numcols == 0) { in PHP_FUNCTION()
1989 if (result->fetch_abs) { in PHP_FUNCTION()
1991 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in PHP_FUNCTION()
1993 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
1997 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2004 result->fetched = rownum; in PHP_FUNCTION()
2006 result->fetched++; in PHP_FUNCTION()
2020 odbc_result *result; in PHP_FUNCTION() local
2044 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2046 if ((result->numcols == 0)) { in PHP_FUNCTION()
2053 if (result->values == NULL) { in PHP_FUNCTION()
2058 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2059 if (!strcasecmp(result->values[i].name, field)) { in PHP_FUNCTION()
2071 if (field_ind >= result->numcols || field_ind < 0) { in PHP_FUNCTION()
2077 if (result->fetched == 0) { in PHP_FUNCTION()
2080 if (result->fetch_abs) in PHP_FUNCTION()
2081 rc = SQLExtendedFetch(result->stmt, SQL_FETCH_NEXT, 1, &crow,RowStatus); in PHP_FUNCTION()
2084 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2090 result->fetched++; in PHP_FUNCTION()
2093 switch(result->values[field_ind].coltype) { in PHP_FUNCTION()
2097 if (result->binmode <= 1) { in PHP_FUNCTION()
2100 if (result->binmode <= 0) { in PHP_FUNCTION()
2104 if (IS_SQL_LONG(result->values[field_ind].coltype)) { in PHP_FUNCTION()
2105 if (result->longreadlen <= 0) { in PHP_FUNCTION()
2108 fieldsize = result->longreadlen; in PHP_FUNCTION()
2111 SQLColAttributes(result->stmt, (SQLUSMALLINT)(field_ind + 1), in PHP_FUNCTION()
2117 fieldsize = (result->longreadlen <= 0) ? 4096 : result->longreadlen; in PHP_FUNCTION()
2123 rc = SQLGetData(result->stmt, (SQLUSMALLINT)(field_ind + 1), sql_c_type, in PHP_FUNCTION()
2124 field, fieldsize, &result->values[field_ind].vallen); in PHP_FUNCTION()
2127 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2132 if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2141 if (result->values[field_ind].coltype == SQL_LONGVARCHAR) { in PHP_FUNCTION()
2147 …RETURN_STRINGL(field, (rc == SQL_SUCCESS_WITH_INFO) ? fieldsize : result->values[field_ind].vallen… in PHP_FUNCTION()
2151 if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2154 RETURN_STRINGL(result->values[field_ind].value, result->values[field_ind].vallen, 1); in PHP_FUNCTION()
2167 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(field_ind + 1),sql_c_type, field, fieldsize, &result-… in PHP_FUNCTION()
2170 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2175 if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2180 PHPWRITE(field,(rc == SQL_SUCCESS_WITH_INFO) ? 4095 : result->values[field_ind].vallen); in PHP_FUNCTION()
2196 odbc_result *result; in PHP_FUNCTION() local
2211 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2213 if (result->numcols == 0) { in PHP_FUNCTION()
2218 if (result->fetch_abs) in PHP_FUNCTION()
2219 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2222 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2236 for (i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2237 php_printf("<th>%s</th>", result->values[i].name); in PHP_FUNCTION()
2243 result->fetched++; in PHP_FUNCTION()
2245 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2247 switch(result->values[i].coltype) { in PHP_FUNCTION()
2251 if (result->binmode <= 0) { in PHP_FUNCTION()
2255 if (result->binmode <= 1) sql_c_type = SQL_C_BINARY; in PHP_FUNCTION()
2257 if (IS_SQL_LONG(result->values[i].coltype) && in PHP_FUNCTION()
2258 result->longreadlen <= 0) { in PHP_FUNCTION()
2264 buf = emalloc(result->longreadlen); in PHP_FUNCTION()
2267 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1),sql_c_type, buf, result->longreadlen, &result-… in PHP_FUNCTION()
2272 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2278 PHPWRITE(buf, result->longreadlen); in PHP_FUNCTION()
2279 } else if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2283 PHPWRITE(buf, result->values[i].vallen); in PHP_FUNCTION()
2288 if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2291 php_printf("<td>%s</td>", result->values[i].value); in PHP_FUNCTION()
2299 if (result->fetch_abs) in PHP_FUNCTION()
2300 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2303 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2307 RETURN_LONG(result->fetched); in PHP_FUNCTION()
2316 odbc_result *result; in PHP_FUNCTION() local
2323 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2324 if (result->values) { in PHP_FUNCTION()
2325 for (i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2326 if (result->values[i].value) { in PHP_FUNCTION()
2327 efree(result->values[i].value); in PHP_FUNCTION()
2330 efree(result->values); in PHP_FUNCTION()
2331 result->values = NULL; in PHP_FUNCTION()
2698 odbc_result *result; in PHP_FUNCTION() local
2705 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2706 SQLRowCount(result->stmt, &rows); in PHP_FUNCTION()
2716 odbc_result *result; in PHP_FUNCTION() local
2723 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2725 if (result->values) { in PHP_FUNCTION()
2726 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2727 if (result->values[i].value) { in PHP_FUNCTION()
2728 efree(result->values[i].value); in PHP_FUNCTION()
2731 efree(result->values); in PHP_FUNCTION()
2732 result->values = NULL; in PHP_FUNCTION()
2735 result->fetched = 0; in PHP_FUNCTION()
2736 rc = SQLMoreResults(result->stmt); in PHP_FUNCTION()
2738 rc = SQLFreeStmt(result->stmt, SQL_UNBIND); in PHP_FUNCTION()
2739 SQLNumParams(result->stmt, &(result->numparams)); in PHP_FUNCTION()
2740 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
2742 if (result->numcols > 0) { in PHP_FUNCTION()
2743 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
2744 efree(result); in PHP_FUNCTION()
2748 result->values = NULL; in PHP_FUNCTION()
2754 odbc_sql_error(result->conn_ptr, result->stmt, "SQLMoreResults"); in PHP_FUNCTION()
2765 odbc_result *result; in PHP_FUNCTION() local
2771 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2772 RETURN_LONG(result->numcols); in PHP_FUNCTION()
2780 odbc_result *result; in PHP_FUNCTION() local
2788 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2790 if (result->numcols == 0) { in PHP_FUNCTION()
2795 if (pv_num > result->numcols) { in PHP_FUNCTION()
2805 RETURN_STRING(result->values[pv_num - 1].name, 1); in PHP_FUNCTION()
2813 odbc_result *result; in PHP_FUNCTION() local
2823 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2825 if (result->numcols == 0) { in PHP_FUNCTION()
2830 if (pv_num > result->numcols) { in PHP_FUNCTION()
2840 SQLColAttributes(result->stmt, (SQLUSMALLINT)pv_num, SQL_COLUMN_TYPE_NAME, tmp, 31, &tmplen, NULL); in PHP_FUNCTION()
2867 odbc_result *result; in PHP_FUNCTION() local
2874 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2876 if (result->numcols == 0) { in PHP_FUNCTION()
2882 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2883 if (strcasecmp(result->values[i].name, fname) == 0) { in PHP_FUNCTION()
3012 odbc_result *result; in PHP_FUNCTION() local
3036 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_handle, -1, "ODBC result", le_result); in PHP_FUNCTION()
3038 rc = SQLSetStmtOption(result->stmt, (unsigned short) pv_opt, pv_val); in PHP_FUNCTION()
3041 odbc_sql_error(result->conn_ptr, result->stmt, "SetStmtOption"); in PHP_FUNCTION()
3064 odbc_result *result = NULL; in PHP_FUNCTION() local
3077 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3079 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3081 efree(result); in PHP_FUNCTION()
3088 efree(result); in PHP_FUNCTION()
3097 rc = SQLTables(result->stmt, in PHP_FUNCTION()
3105 efree(result); in PHP_FUNCTION()
3109 result->numparams = 0; in PHP_FUNCTION()
3110 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3112 if (result->numcols > 0) { in PHP_FUNCTION()
3113 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3114 efree(result); in PHP_FUNCTION()
3118 result->values = NULL; in PHP_FUNCTION()
3120 result->conn_ptr = conn; in PHP_FUNCTION()
3121 result->fetched = 0; in PHP_FUNCTION()
3122 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3131 odbc_result *result = NULL; in PHP_FUNCTION() local
3144 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3146 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3148 efree(result); in PHP_FUNCTION()
3155 efree(result); in PHP_FUNCTION()
3166 rc = SQLColumns(result->stmt, in PHP_FUNCTION()
3174 efree(result); in PHP_FUNCTION()
3178 result->numparams = 0; in PHP_FUNCTION()
3179 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3181 if (result->numcols > 0) { in PHP_FUNCTION()
3182 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3183 efree(result); in PHP_FUNCTION()
3187 result->values = NULL; in PHP_FUNCTION()
3189 result->conn_ptr = conn; in PHP_FUNCTION()
3190 result->fetched = 0; in PHP_FUNCTION()
3191 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3201 odbc_result *result = NULL; in PHP_FUNCTION() local
3214 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3216 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3218 efree(result); in PHP_FUNCTION()
3225 efree(result); in PHP_FUNCTION()
3229 rc = SQLColumnPrivileges(result->stmt, in PHP_FUNCTION()
3237 efree(result); in PHP_FUNCTION()
3241 result->numparams = 0; in PHP_FUNCTION()
3242 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3244 if (result->numcols > 0) { in PHP_FUNCTION()
3245 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3246 efree(result); in PHP_FUNCTION()
3250 result->values = NULL; in PHP_FUNCTION()
3252 result->conn_ptr = conn; in PHP_FUNCTION()
3253 result->fetched = 0; in PHP_FUNCTION()
3254 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3265 odbc_result *result = NULL; in PHP_FUNCTION() local
3290 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3292 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3294 efree(result); in PHP_FUNCTION()
3301 efree(result); in PHP_FUNCTION()
3305 rc = SQLForeignKeys(result->stmt, in PHP_FUNCTION()
3315 efree(result); in PHP_FUNCTION()
3319 result->numparams = 0; in PHP_FUNCTION()
3320 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3322 if (result->numcols > 0) { in PHP_FUNCTION()
3323 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3324 efree(result); in PHP_FUNCTION()
3328 result->values = NULL; in PHP_FUNCTION()
3330 result->conn_ptr = conn; in PHP_FUNCTION()
3331 result->fetched = 0; in PHP_FUNCTION()
3332 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3343 odbc_result *result = NULL; in PHP_FUNCTION() local
3356 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3358 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3360 efree(result); in PHP_FUNCTION()
3367 efree(result); in PHP_FUNCTION()
3371 rc = SQLGetTypeInfo(result->stmt, data_type ); in PHP_FUNCTION()
3375 efree(result); in PHP_FUNCTION()
3379 result->numparams = 0; in PHP_FUNCTION()
3380 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3382 if (result->numcols > 0) { in PHP_FUNCTION()
3383 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3384 efree(result); in PHP_FUNCTION()
3388 result->values = NULL; in PHP_FUNCTION()
3390 result->conn_ptr = conn; in PHP_FUNCTION()
3391 result->fetched = 0; in PHP_FUNCTION()
3392 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3401 odbc_result *result = NULL; in PHP_FUNCTION() local
3413 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3415 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3417 efree(result); in PHP_FUNCTION()
3424 efree(result); in PHP_FUNCTION()
3428 rc = SQLPrimaryKeys(result->stmt, in PHP_FUNCTION()
3435 efree(result); in PHP_FUNCTION()
3439 result->numparams = 0; in PHP_FUNCTION()
3440 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3442 if (result->numcols > 0) { in PHP_FUNCTION()
3443 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3444 efree(result); in PHP_FUNCTION()
3448 result->values = NULL; in PHP_FUNCTION()
3450 result->conn_ptr = conn; in PHP_FUNCTION()
3451 result->fetched = 0; in PHP_FUNCTION()
3452 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3462 odbc_result *result = NULL; in PHP_FUNCTION() local
3479 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3481 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3483 efree(result); in PHP_FUNCTION()
3490 efree(result); in PHP_FUNCTION()
3494 rc = SQLProcedureColumns(result->stmt, in PHP_FUNCTION()
3502 efree(result); in PHP_FUNCTION()
3506 result->numparams = 0; in PHP_FUNCTION()
3507 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3509 if (result->numcols > 0) { in PHP_FUNCTION()
3510 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3511 efree(result); in PHP_FUNCTION()
3515 result->values = NULL; in PHP_FUNCTION()
3517 result->conn_ptr = conn; in PHP_FUNCTION()
3518 result->fetched = 0; in PHP_FUNCTION()
3519 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3530 odbc_result *result = NULL; in PHP_FUNCTION() local
3546 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3548 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3550 efree(result); in PHP_FUNCTION()
3557 efree(result); in PHP_FUNCTION()
3561 rc = SQLProcedures(result->stmt, in PHP_FUNCTION()
3568 efree(result); in PHP_FUNCTION()
3572 result->numparams = 0; in PHP_FUNCTION()
3573 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3575 if (result->numcols > 0) { in PHP_FUNCTION()
3576 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3577 efree(result); in PHP_FUNCTION()
3581 result->values = NULL; in PHP_FUNCTION()
3583 result->conn_ptr = conn; in PHP_FUNCTION()
3584 result->fetched = 0; in PHP_FUNCTION()
3585 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3596 odbc_result *result = NULL; in PHP_FUNCTION() local
3614 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3616 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3618 efree(result); in PHP_FUNCTION()
3625 efree(result); in PHP_FUNCTION()
3629 rc = SQLSpecialColumns(result->stmt, in PHP_FUNCTION()
3639 efree(result); in PHP_FUNCTION()
3643 result->numparams = 0; in PHP_FUNCTION()
3644 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3646 if (result->numcols > 0) { in PHP_FUNCTION()
3647 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3648 efree(result); in PHP_FUNCTION()
3652 result->values = NULL; in PHP_FUNCTION()
3654 result->conn_ptr = conn; in PHP_FUNCTION()
3655 result->fetched = 0; in PHP_FUNCTION()
3656 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3666 odbc_result *result = NULL; in PHP_FUNCTION() local
3683 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3685 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3687 efree(result); in PHP_FUNCTION()
3694 efree(result); in PHP_FUNCTION()
3698 rc = SQLStatistics(result->stmt, in PHP_FUNCTION()
3707 efree(result); in PHP_FUNCTION()
3711 result->numparams = 0; in PHP_FUNCTION()
3712 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3714 if (result->numcols > 0) { in PHP_FUNCTION()
3715 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3716 efree(result); in PHP_FUNCTION()
3720 result->values = NULL; in PHP_FUNCTION()
3722 result->conn_ptr = conn; in PHP_FUNCTION()
3723 result->fetched = 0; in PHP_FUNCTION()
3724 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3734 odbc_result *result = NULL; in PHP_FUNCTION() local
3746 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3748 rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3750 efree(result); in PHP_FUNCTION()
3757 efree(result); in PHP_FUNCTION()
3761 rc = SQLTablePrivileges(result->stmt, in PHP_FUNCTION()
3768 efree(result); in PHP_FUNCTION()
3772 result->numparams = 0; in PHP_FUNCTION()
3773 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3775 if (result->numcols > 0) { in PHP_FUNCTION()
3776 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3777 efree(result); in PHP_FUNCTION()
3781 result->values = NULL; in PHP_FUNCTION()
3783 result->conn_ptr = conn; in PHP_FUNCTION()
3784 result->fetched = 0; in PHP_FUNCTION()
3785 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()