Lines Matching refs:result

112 	ZEND_ARG_INFO(0, result)
117 ZEND_ARG_INFO(0, result)
928 odbc_result *result; in php_odbc_fetch_attribs() local
937 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in php_odbc_fetch_attribs()
939 result->longreadlen = flag; in php_odbc_fetch_attribs()
941 result->binmode = flag; in php_odbc_fetch_attribs()
955 int odbc_bindcols(odbc_result *result TSRMLS_DC) in odbc_bindcols()
964 result->values = (odbc_result_value *) safe_emalloc(sizeof(odbc_result_value), result->numcols, 0); in odbc_bindcols()
966 result->longreadlen = ODBCG(defaultlrl); in odbc_bindcols()
967 result->binmode = ODBCG(defaultbinmode); in odbc_bindcols()
969 for(i = 0; i < result->numcols; i++) { in odbc_bindcols()
973 rc = PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(i+1), PHP_ODBC_SQL_DESC_NAME, in odbc_bindcols()
974 result->values[i].name, sizeof(result->values[i].name), &colnamelen, 0); in odbc_bindcols()
975 rc = PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_TYPE, in odbc_bindcols()
976 NULL, 0, NULL, &result->values[i].coltype); in odbc_bindcols()
982 switch(result->values[i].coltype) { in odbc_bindcols()
990 result->values[i].value = NULL; in odbc_bindcols()
995 result->values[i].value = (char *)emalloc(27); in odbc_bindcols()
996 SQLBindCol(result->stmt, (SQLUSMALLINT)(i+1), SQL_C_CHAR, result->values[i].value, in odbc_bindcols()
997 27, &result->values[i].vallen); in odbc_bindcols()
1010 rc = PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(i+1), colfieldid, in odbc_bindcols()
1017 rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_DISPLAY_SIZE, in odbc_bindcols()
1022 if (result->values[i].coltype == SQL_WVARCHAR && displaysize == 0) { in odbc_bindcols()
1023 result->values[i].coltype = SQL_WLONGVARCHAR; in odbc_bindcols()
1024 result->values[i].value = NULL; in odbc_bindcols()
1029 if (result->values[i].coltype == SQL_TIMESTAMP) { in odbc_bindcols()
1037 result->values[i].value = (char *)emalloc(displaysize + 1); in odbc_bindcols()
1038 rc = SQLBindCol(result->stmt, (SQLUSMALLINT)(i+1), SQL_C_CHAR, result->values[i].value, in odbc_bindcols()
1039 displaysize + 1, &result->values[i].vallen); in odbc_bindcols()
1084 odbc_result *result; in odbc_column_lengths() local
1103 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in odbc_column_lengths()
1105 if (result->numcols == 0) { in odbc_column_lengths()
1110 if (pv_num > result->numcols) { in odbc_column_lengths()
1120 …PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)pv_num, (SQLUSMALLINT) (type?SQL_COLUMN_SCALE… in odbc_column_lengths()
1193 odbc_result *result = NULL; in PHP_FUNCTION() local
1207 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
1209 result->numparams = 0; in PHP_FUNCTION()
1210 result->param_info = NULL; in PHP_FUNCTION()
1212 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
1214 efree(result); in PHP_FUNCTION()
1221 efree(result); in PHP_FUNCTION()
1230 if ((result->fetch_abs = (scrollopts & SQL_FD_FETCH_ABSOLUTE))) { in PHP_FUNCTION()
1234 SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, ODBCG(default_cursortype)); in PHP_FUNCTION()
1237 result->fetch_abs = 0; in PHP_FUNCTION()
1241 rc = SQLPrepare(result->stmt, query, SQL_NTS); in PHP_FUNCTION()
1246 odbc_sql_error(conn, result->stmt, "SQLPrepare"); in PHP_FUNCTION()
1249 odbc_sql_error(conn, result->stmt, "SQLPrepare"); in PHP_FUNCTION()
1253 SQLNumParams(result->stmt, &(result->numparams)); in PHP_FUNCTION()
1254 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1256 if (result->numcols > 0) { in PHP_FUNCTION()
1257 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
1258 efree(result); in PHP_FUNCTION()
1262 result->values = NULL; in PHP_FUNCTION()
1265 result->conn_ptr = conn; in PHP_FUNCTION()
1266 result->fetched = 0; in PHP_FUNCTION()
1268result->param_info = (odbc_param_info *) safe_emalloc(sizeof(odbc_param_info), result->numparams, … in PHP_FUNCTION()
1269 for (i=0;i<result->numparams;i++) { in PHP_FUNCTION()
1270 …rc = SQLDescribeParam(result->stmt, (SQLUSMALLINT)(i+1), &result->param_info[i].sqltype, &result->… in PHP_FUNCTION()
1271 &result->param_info[i].scale, &result->param_info[i].nullable); in PHP_FUNCTION()
1273 odbc_sql_error(result->conn_ptr, result->stmt, "SQLDescribeParameter"); in PHP_FUNCTION()
1274 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1275 efree(result->param_info); in PHP_FUNCTION()
1276 efree(result); in PHP_FUNCTION()
1280 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
1301 odbc_result *result; in PHP_FUNCTION() local
1311 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
1314 if (result->numparams > 0 && numArgs == 1) { in PHP_FUNCTION()
1319 if (result->numparams > 0) { in PHP_FUNCTION()
1320 if ((ne = zend_hash_num_elements(Z_ARRVAL_P(pv_param_arr))) < result->numparams) { in PHP_FUNCTION()
1321 …(NULL TSRMLS_CC, E_WARNING,"Not enough parameters (%d should be %d) given", ne, result->numparams); in PHP_FUNCTION()
1326 params = (params_t *)safe_emalloc(sizeof(params_t), result->numparams, 0); in PHP_FUNCTION()
1327 for(i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1331 for(i = 1; i <= result->numparams; i++) { in PHP_FUNCTION()
1334 SQLFreeStmt(result->stmt,SQL_RESET_PARAMS); in PHP_FUNCTION()
1335 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()
1361 if (IS_SQL_BINARY(result->param_info[i-1].sqltype)) { in PHP_FUNCTION()
1380 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1381 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1392 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1393 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1407 rc = SQLBindParameter(result->stmt, (SQLUSMALLINT)i, SQL_PARAM_INPUT, in PHP_FUNCTION()
1408 …ctype, result->param_info[i-1].sqltype, result->param_info[i-1].precision, result->param_info[i-1]… in PHP_FUNCTION()
1419 rc = SQLBindParameter(result->stmt, (SQLUSMALLINT)i, SQL_PARAM_INPUT, in PHP_FUNCTION()
1420 …ctype, result->param_info[i-1].sqltype, result->param_info[i-1].precision, result->param_info[i-1]… in PHP_FUNCTION()
1425 odbc_sql_error(result->conn_ptr, result->stmt, "SQLBindParameter"); in PHP_FUNCTION()
1426 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1427 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1439 rc = SQLFreeStmt(result->stmt, SQL_CLOSE); in PHP_FUNCTION()
1442 odbc_sql_error(result->conn_ptr, result->stmt, "SQLFreeStmt"); in PHP_FUNCTION()
1445 rc = SQLExecute(result->stmt); in PHP_FUNCTION()
1447 result->fetched = 0; in PHP_FUNCTION()
1452 rc = SQLParamData(result->stmt, (void*)&fp); in PHP_FUNCTION()
1455 SQLPutData(result->stmt, (void*)&buf, nbytes); in PHP_FUNCTION()
1465 odbc_sql_error(result->conn_ptr, result->stmt, "SQLExecute"); in PHP_FUNCTION()
1468 odbc_sql_error(result->conn_ptr, result->stmt, "SQLExecute"); in PHP_FUNCTION()
1473 if (result->numparams > 0) { in PHP_FUNCTION()
1474 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1475 for(i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1487 if (result->numcols == 0) { in PHP_FUNCTION()
1488 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1490 if (result->numcols > 0) { in PHP_FUNCTION()
1491 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
1492 efree(result); in PHP_FUNCTION()
1496 result->values = NULL; in PHP_FUNCTION()
1510 odbc_result *result; in PHP_FUNCTION() local
1517 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
1519 …rc = SQLGetInfo(result->conn_ptr->hdbc,SQL_MAX_CURSOR_NAME_LEN, (void *)&max_len,sizeof(max_len),&… in PHP_FUNCTION()
1526 rc = SQLGetCursorName(result->stmt,cursorname,(SQLSMALLINT)max_len,&len); in PHP_FUNCTION()
1533 SQLError( result->conn_ptr->henv, result->conn_ptr->hdbc, in PHP_FUNCTION()
1534 result->stmt, state, &error, errormsg, in PHP_FUNCTION()
1537 snprintf(cursorname, max_len+1, "php_curs_%d", (int)result->stmt); in PHP_FUNCTION()
1538 if (SQLSetCursorName(result->stmt,cursorname,SQL_NTS) != SQL_SUCCESS) { in PHP_FUNCTION()
1539 odbc_sql_error(result->conn_ptr, result->stmt, "SQLSetCursorName"); in PHP_FUNCTION()
1622 odbc_result *result = NULL; in PHP_FUNCTION() local
1637 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
1639 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
1642 efree(result); in PHP_FUNCTION()
1648 efree(result); in PHP_FUNCTION()
1657 if ((result->fetch_abs = (scrollopts & SQL_FD_FETCH_ABSOLUTE))) { in PHP_FUNCTION()
1661 SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, ODBCG(default_cursortype)); in PHP_FUNCTION()
1664 result->fetch_abs = 0; in PHP_FUNCTION()
1668 rc = SQLExecDirect(result->stmt, query, SQL_NTS); in PHP_FUNCTION()
1673 odbc_sql_error(conn, result->stmt, "SQLExecDirect"); in PHP_FUNCTION()
1674 SQLFreeStmt(result->stmt, SQL_DROP); in PHP_FUNCTION()
1675 efree(result); in PHP_FUNCTION()
1679 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1682 if (result->numcols > 0) { in PHP_FUNCTION()
1683 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
1684 efree(result); in PHP_FUNCTION()
1688 result->values = NULL; in PHP_FUNCTION()
1691 result->conn_ptr = conn; in PHP_FUNCTION()
1692 result->fetched = 0; in PHP_FUNCTION()
1693 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
1705 odbc_result *result; in php_odbc_fetch_hash() local
1729 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in php_odbc_fetch_hash()
1731 if (result->numcols == 0) { in php_odbc_fetch_hash()
1737 if (result->fetch_abs) { in php_odbc_fetch_hash()
1739 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in php_odbc_fetch_hash()
1741 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in php_odbc_fetch_hash()
1745 rc = SQLFetch(result->stmt); in php_odbc_fetch_hash()
1754 if (rownum > 0 && result->fetch_abs) in php_odbc_fetch_hash()
1755 result->fetched = rownum; in php_odbc_fetch_hash()
1758 result->fetched++; in php_odbc_fetch_hash()
1760 for(i = 0; i < result->numcols; i++) { in php_odbc_fetch_hash()
1766 switch(result->values[i].coltype) { in php_odbc_fetch_hash()
1770 if (result->binmode <= 0) { in php_odbc_fetch_hash()
1774 if (result->binmode == 1) { in php_odbc_fetch_hash()
1781 if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { in php_odbc_fetch_hash()
1786 buf = emalloc(result->longreadlen + 1); in php_odbc_fetch_hash()
1789 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1), sql_c_type, buf, result->longreadlen + 1, &re… in php_odbc_fetch_hash()
1792 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in php_odbc_fetch_hash()
1798 Z_STRLEN_P(tmp) = result->longreadlen; in php_odbc_fetch_hash()
1799 } else if (result->values[i].vallen == SQL_NULL_DATA) { in php_odbc_fetch_hash()
1803 Z_STRLEN_P(tmp) = result->values[i].vallen; in php_odbc_fetch_hash()
1809 if (result->values[i].vallen == SQL_NULL_DATA) { in php_odbc_fetch_hash()
1813 Z_STRLEN_P(tmp) = result->values[i].vallen; in php_odbc_fetch_hash()
1814 Z_STRVAL_P(tmp) = estrndup(result->values[i].value,Z_STRLEN_P(tmp)); in php_odbc_fetch_hash()
1821 if (!*(result->values[i].name) && Z_TYPE_P(tmp) == IS_STRING) { in php_odbc_fetch_hash()
1824 …zend_hash_update(Z_ARRVAL_P(return_value), result->values[i].name, strlen(result->values[i].name)+… in php_odbc_fetch_hash()
1860 odbc_result *result; in PHP_FUNCTION() local
1884 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
1886 if (result->numcols == 0) { in PHP_FUNCTION()
1896 if (result->fetch_abs) { in PHP_FUNCTION()
1898 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in PHP_FUNCTION()
1900 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
1904 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
1911 if (rownum > 0 && result->fetch_abs) in PHP_FUNCTION()
1912 result->fetched = rownum; in PHP_FUNCTION()
1915 result->fetched++; in PHP_FUNCTION()
1917 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
1923 switch(result->values[i].coltype) { in PHP_FUNCTION()
1927 if (result->binmode <= 0) { in PHP_FUNCTION()
1931 if (result->binmode == 1) sql_c_type = SQL_C_BINARY; in PHP_FUNCTION()
1937 if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { in PHP_FUNCTION()
1943 buf = emalloc(result->longreadlen + 1); in PHP_FUNCTION()
1945 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1),sql_c_type, buf, result->longreadlen + 1, &res… in PHP_FUNCTION()
1948 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
1953 Z_STRLEN_P(tmp) = result->longreadlen; in PHP_FUNCTION()
1954 } else if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
1958 Z_STRLEN_P(tmp) = result->values[i].vallen; in PHP_FUNCTION()
1964 if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
1968 Z_STRLEN_P(tmp) = result->values[i].vallen; in PHP_FUNCTION()
1969 Z_STRVAL_P(tmp) = estrndup(result->values[i].value,Z_STRLEN_P(tmp)); in PHP_FUNCTION()
1975 RETURN_LONG(result->numcols); in PHP_FUNCTION()
1984 odbc_result *result; in PHP_FUNCTION() local
1992 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
1993 if (result->numcols == 0) { in PHP_FUNCTION()
1997 rc = SQLFetchPrev(result->stmt); in PHP_FUNCTION()
2003 if (result->fetched > 1) { in PHP_FUNCTION()
2004 result->fetched--; in PHP_FUNCTION()
2017 odbc_result *result; in PHP_FUNCTION() local
2032 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2034 if (result->numcols == 0) { in PHP_FUNCTION()
2040 if (result->fetch_abs) { in PHP_FUNCTION()
2042 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in PHP_FUNCTION()
2044 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2048 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2055 result->fetched = rownum; in PHP_FUNCTION()
2057 result->fetched++; in PHP_FUNCTION()
2071 odbc_result *result; in PHP_FUNCTION() local
2095 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2097 if ((result->numcols == 0)) { in PHP_FUNCTION()
2104 if (result->values == NULL) { in PHP_FUNCTION()
2109 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2110 if (!strcasecmp(result->values[i].name, field)) { in PHP_FUNCTION()
2122 if (field_ind >= result->numcols || field_ind < 0) { in PHP_FUNCTION()
2128 if (result->fetched == 0) { in PHP_FUNCTION()
2131 if (result->fetch_abs) in PHP_FUNCTION()
2132 rc = SQLExtendedFetch(result->stmt, SQL_FETCH_NEXT, 1, &crow,RowStatus); in PHP_FUNCTION()
2135 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2141 result->fetched++; in PHP_FUNCTION()
2144 switch(result->values[field_ind].coltype) { in PHP_FUNCTION()
2148 if (result->binmode <= 1) { in PHP_FUNCTION()
2151 if (result->binmode <= 0) { in PHP_FUNCTION()
2158 if (IS_SQL_LONG(result->values[field_ind].coltype)) { in PHP_FUNCTION()
2159 if (result->longreadlen <= 0) { in PHP_FUNCTION()
2162 fieldsize = result->longreadlen; in PHP_FUNCTION()
2165 PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(field_ind + 1), in PHP_FUNCTION()
2171 fieldsize = (result->longreadlen <= 0) ? 4096 : result->longreadlen; in PHP_FUNCTION()
2177 rc = SQLGetData(result->stmt, (SQLUSMALLINT)(field_ind + 1), sql_c_type, in PHP_FUNCTION()
2178 field, fieldsize, &result->values[field_ind].vallen); in PHP_FUNCTION()
2181 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2186 if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2195 if ((result->values[field_ind].coltype == SQL_LONGVARCHAR) in PHP_FUNCTION()
2197 || (result->values[field_ind].coltype == SQL_WLONGVARCHAR) in PHP_FUNCTION()
2205 …RETURN_STRINGL(field, (rc == SQL_SUCCESS_WITH_INFO) ? fieldsize : result->values[field_ind].vallen… in PHP_FUNCTION()
2209 if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2212 RETURN_STRINGL(result->values[field_ind].value, result->values[field_ind].vallen, 1); in PHP_FUNCTION()
2225 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(field_ind + 1),sql_c_type, field, fieldsize, &result-… in PHP_FUNCTION()
2228 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2233 if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2238 PHPWRITE(field,(rc == SQL_SUCCESS_WITH_INFO) ? 4095 : result->values[field_ind].vallen); in PHP_FUNCTION()
2254 odbc_result *result; in PHP_FUNCTION() local
2269 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2271 if (result->numcols == 0) { in PHP_FUNCTION()
2276 if (result->fetch_abs) in PHP_FUNCTION()
2277 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2280 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2294 for (i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2295 php_printf("<th>%s</th>", result->values[i].name); in PHP_FUNCTION()
2301 result->fetched++; in PHP_FUNCTION()
2303 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2305 switch(result->values[i].coltype) { in PHP_FUNCTION()
2309 if (result->binmode <= 0) { in PHP_FUNCTION()
2313 if (result->binmode <= 1) sql_c_type = SQL_C_BINARY; in PHP_FUNCTION()
2318 if (IS_SQL_LONG(result->values[i].coltype) && in PHP_FUNCTION()
2319 result->longreadlen <= 0) { in PHP_FUNCTION()
2325 buf = emalloc(result->longreadlen); in PHP_FUNCTION()
2328 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1),sql_c_type, buf, result->longreadlen, &result-… in PHP_FUNCTION()
2333 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2339 PHPWRITE(buf, result->longreadlen); in PHP_FUNCTION()
2340 } else if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2344 PHPWRITE(buf, result->values[i].vallen); in PHP_FUNCTION()
2349 if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2352 php_printf("<td>%s</td>", result->values[i].value); in PHP_FUNCTION()
2360 if (result->fetch_abs) in PHP_FUNCTION()
2361 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2364 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2368 RETURN_LONG(result->fetched); in PHP_FUNCTION()
2377 odbc_result *result; in PHP_FUNCTION() local
2384 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2385 if (result->values) { in PHP_FUNCTION()
2386 for (i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2387 if (result->values[i].value) { in PHP_FUNCTION()
2388 efree(result->values[i].value); in PHP_FUNCTION()
2391 efree(result->values); in PHP_FUNCTION()
2392 result->values = NULL; in PHP_FUNCTION()
2759 odbc_result *result; in PHP_FUNCTION() local
2766 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2767 SQLRowCount(result->stmt, &rows); in PHP_FUNCTION()
2777 odbc_result *result; in PHP_FUNCTION() local
2784 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2786 if (result->values) { in PHP_FUNCTION()
2787 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2788 if (result->values[i].value) { in PHP_FUNCTION()
2789 efree(result->values[i].value); in PHP_FUNCTION()
2792 efree(result->values); in PHP_FUNCTION()
2793 result->values = NULL; in PHP_FUNCTION()
2796 result->fetched = 0; in PHP_FUNCTION()
2797 rc = SQLMoreResults(result->stmt); in PHP_FUNCTION()
2799 rc = SQLFreeStmt(result->stmt, SQL_UNBIND); in PHP_FUNCTION()
2800 SQLNumParams(result->stmt, &(result->numparams)); in PHP_FUNCTION()
2801 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
2803 if (result->numcols > 0) { in PHP_FUNCTION()
2804 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
2805 efree(result); in PHP_FUNCTION()
2809 result->values = NULL; in PHP_FUNCTION()
2815 odbc_sql_error(result->conn_ptr, result->stmt, "SQLMoreResults"); in PHP_FUNCTION()
2826 odbc_result *result; in PHP_FUNCTION() local
2832 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2833 RETURN_LONG(result->numcols); in PHP_FUNCTION()
2841 odbc_result *result; in PHP_FUNCTION() local
2849 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2851 if (result->numcols == 0) { in PHP_FUNCTION()
2856 if (pv_num > result->numcols) { in PHP_FUNCTION()
2866 RETURN_STRING(result->values[pv_num - 1].name, 1); in PHP_FUNCTION()
2874 odbc_result *result; in PHP_FUNCTION() local
2884 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2886 if (result->numcols == 0) { in PHP_FUNCTION()
2891 if (pv_num > result->numcols) { in PHP_FUNCTION()
2901 …PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)pv_num, SQL_COLUMN_TYPE_NAME, tmp, 31, &tmple… in PHP_FUNCTION()
2928 odbc_result *result; in PHP_FUNCTION() local
2935 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2937 if (result->numcols == 0) { in PHP_FUNCTION()
2943 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2944 if (strcasecmp(result->values[i].name, fname) == 0) { in PHP_FUNCTION()
3073 odbc_result *result; in PHP_FUNCTION() local
3097 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_handle, -1, "ODBC result", le_result); in PHP_FUNCTION()
3099 rc = SQLSetStmtOption(result->stmt, (unsigned short) pv_opt, pv_val); in PHP_FUNCTION()
3102 odbc_sql_error(result->conn_ptr, result->stmt, "SetStmtOption"); in PHP_FUNCTION()
3125 odbc_result *result = NULL; in PHP_FUNCTION() local
3138 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3140 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3142 efree(result); in PHP_FUNCTION()
3149 efree(result); in PHP_FUNCTION()
3158 rc = SQLTables(result->stmt, in PHP_FUNCTION()
3166 efree(result); in PHP_FUNCTION()
3170 result->numparams = 0; in PHP_FUNCTION()
3171 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3173 if (result->numcols > 0) { in PHP_FUNCTION()
3174 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3175 efree(result); in PHP_FUNCTION()
3179 result->values = NULL; in PHP_FUNCTION()
3181 result->conn_ptr = conn; in PHP_FUNCTION()
3182 result->fetched = 0; in PHP_FUNCTION()
3183 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3192 odbc_result *result = NULL; in PHP_FUNCTION() local
3205 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3207 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3209 efree(result); in PHP_FUNCTION()
3216 efree(result); in PHP_FUNCTION()
3227 rc = SQLColumns(result->stmt, in PHP_FUNCTION()
3235 efree(result); in PHP_FUNCTION()
3239 result->numparams = 0; in PHP_FUNCTION()
3240 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3242 if (result->numcols > 0) { in PHP_FUNCTION()
3243 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3244 efree(result); in PHP_FUNCTION()
3248 result->values = NULL; in PHP_FUNCTION()
3250 result->conn_ptr = conn; in PHP_FUNCTION()
3251 result->fetched = 0; in PHP_FUNCTION()
3252 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3262 odbc_result *result = NULL; in PHP_FUNCTION() local
3275 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3277 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3279 efree(result); in PHP_FUNCTION()
3286 efree(result); in PHP_FUNCTION()
3290 rc = SQLColumnPrivileges(result->stmt, in PHP_FUNCTION()
3298 efree(result); in PHP_FUNCTION()
3302 result->numparams = 0; in PHP_FUNCTION()
3303 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3305 if (result->numcols > 0) { in PHP_FUNCTION()
3306 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3307 efree(result); in PHP_FUNCTION()
3311 result->values = NULL; in PHP_FUNCTION()
3313 result->conn_ptr = conn; in PHP_FUNCTION()
3314 result->fetched = 0; in PHP_FUNCTION()
3315 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3326 odbc_result *result = NULL; in PHP_FUNCTION() local
3351 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3353 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3355 efree(result); in PHP_FUNCTION()
3362 efree(result); in PHP_FUNCTION()
3366 rc = SQLForeignKeys(result->stmt, in PHP_FUNCTION()
3376 efree(result); in PHP_FUNCTION()
3380 result->numparams = 0; in PHP_FUNCTION()
3381 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3383 if (result->numcols > 0) { in PHP_FUNCTION()
3384 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3385 efree(result); in PHP_FUNCTION()
3389 result->values = NULL; in PHP_FUNCTION()
3391 result->conn_ptr = conn; in PHP_FUNCTION()
3392 result->fetched = 0; in PHP_FUNCTION()
3393 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3404 odbc_result *result = NULL; in PHP_FUNCTION() local
3417 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3419 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3421 efree(result); in PHP_FUNCTION()
3428 efree(result); in PHP_FUNCTION()
3432 rc = SQLGetTypeInfo(result->stmt, data_type ); in PHP_FUNCTION()
3436 efree(result); in PHP_FUNCTION()
3440 result->numparams = 0; in PHP_FUNCTION()
3441 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3443 if (result->numcols > 0) { in PHP_FUNCTION()
3444 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3445 efree(result); in PHP_FUNCTION()
3449 result->values = NULL; in PHP_FUNCTION()
3451 result->conn_ptr = conn; in PHP_FUNCTION()
3452 result->fetched = 0; in PHP_FUNCTION()
3453 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3462 odbc_result *result = NULL; in PHP_FUNCTION() local
3474 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3476 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3478 efree(result); in PHP_FUNCTION()
3485 efree(result); in PHP_FUNCTION()
3489 rc = SQLPrimaryKeys(result->stmt, in PHP_FUNCTION()
3496 efree(result); in PHP_FUNCTION()
3500 result->numparams = 0; in PHP_FUNCTION()
3501 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3503 if (result->numcols > 0) { in PHP_FUNCTION()
3504 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3505 efree(result); in PHP_FUNCTION()
3509 result->values = NULL; in PHP_FUNCTION()
3511 result->conn_ptr = conn; in PHP_FUNCTION()
3512 result->fetched = 0; in PHP_FUNCTION()
3513 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3523 odbc_result *result = NULL; in PHP_FUNCTION() local
3540 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3542 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3544 efree(result); in PHP_FUNCTION()
3551 efree(result); in PHP_FUNCTION()
3555 rc = SQLProcedureColumns(result->stmt, in PHP_FUNCTION()
3563 efree(result); in PHP_FUNCTION()
3567 result->numparams = 0; in PHP_FUNCTION()
3568 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3570 if (result->numcols > 0) { in PHP_FUNCTION()
3571 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3572 efree(result); in PHP_FUNCTION()
3576 result->values = NULL; in PHP_FUNCTION()
3578 result->conn_ptr = conn; in PHP_FUNCTION()
3579 result->fetched = 0; in PHP_FUNCTION()
3580 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3591 odbc_result *result = NULL; in PHP_FUNCTION() local
3607 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3609 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3611 efree(result); in PHP_FUNCTION()
3618 efree(result); in PHP_FUNCTION()
3622 rc = SQLProcedures(result->stmt, in PHP_FUNCTION()
3629 efree(result); in PHP_FUNCTION()
3633 result->numparams = 0; in PHP_FUNCTION()
3634 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3636 if (result->numcols > 0) { in PHP_FUNCTION()
3637 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3638 efree(result); in PHP_FUNCTION()
3642 result->values = NULL; in PHP_FUNCTION()
3644 result->conn_ptr = conn; in PHP_FUNCTION()
3645 result->fetched = 0; in PHP_FUNCTION()
3646 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3657 odbc_result *result = NULL; in PHP_FUNCTION() local
3675 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3677 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3679 efree(result); in PHP_FUNCTION()
3686 efree(result); in PHP_FUNCTION()
3690 rc = SQLSpecialColumns(result->stmt, in PHP_FUNCTION()
3700 efree(result); in PHP_FUNCTION()
3704 result->numparams = 0; in PHP_FUNCTION()
3705 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3707 if (result->numcols > 0) { in PHP_FUNCTION()
3708 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3709 efree(result); in PHP_FUNCTION()
3713 result->values = NULL; in PHP_FUNCTION()
3715 result->conn_ptr = conn; in PHP_FUNCTION()
3716 result->fetched = 0; in PHP_FUNCTION()
3717 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3727 odbc_result *result = NULL; in PHP_FUNCTION() local
3744 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3746 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3748 efree(result); in PHP_FUNCTION()
3755 efree(result); in PHP_FUNCTION()
3759 rc = SQLStatistics(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()
3795 odbc_result *result = NULL; in PHP_FUNCTION() local
3807 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3809 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3811 efree(result); in PHP_FUNCTION()
3818 efree(result); in PHP_FUNCTION()
3822 rc = SQLTablePrivileges(result->stmt, in PHP_FUNCTION()
3829 efree(result); in PHP_FUNCTION()
3833 result->numparams = 0; in PHP_FUNCTION()
3834 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3836 if (result->numcols > 0) { in PHP_FUNCTION()
3837 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3838 efree(result); in PHP_FUNCTION()
3842 result->values = NULL; in PHP_FUNCTION()
3844 result->conn_ptr = conn; in PHP_FUNCTION()
3845 result->fetched = 0; in PHP_FUNCTION()
3846 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()