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()
954 result->values = (odbc_result_value *) safe_emalloc(sizeof(odbc_result_value), result->numcols, 0); in odbc_bindcols()
956 result->longreadlen = ODBCG(defaultlrl); in odbc_bindcols()
957 result->binmode = ODBCG(defaultbinmode); in odbc_bindcols()
959 for(i = 0; i < result->numcols; i++) { in odbc_bindcols()
963 rc = PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(i+1), PHP_ODBC_SQL_DESC_NAME, in odbc_bindcols()
964 result->values[i].name, sizeof(result->values[i].name), &colnamelen, 0); in odbc_bindcols()
965 rc = PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_TYPE, in odbc_bindcols()
966 NULL, 0, NULL, &result->values[i].coltype); in odbc_bindcols()
972 switch(result->values[i].coltype) { in odbc_bindcols()
980 result->values[i].value = NULL; in odbc_bindcols()
985 result->values[i].value = (char *)emalloc(27); in odbc_bindcols()
986 SQLBindCol(result->stmt, (SQLUSMALLINT)(i+1), SQL_C_CHAR, result->values[i].value, in odbc_bindcols()
987 27, &result->values[i].vallen); in odbc_bindcols()
1000 rc = PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(i+1), colfieldid, in odbc_bindcols()
1007 rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_DISPLAY_SIZE, in odbc_bindcols()
1012 if (result->values[i].coltype == SQL_WVARCHAR && displaysize == 0) { in odbc_bindcols()
1013 result->values[i].coltype = SQL_WLONGVARCHAR; in odbc_bindcols()
1014 result->values[i].value = NULL; in odbc_bindcols()
1019 if (result->values[i].coltype == SQL_TIMESTAMP) { in odbc_bindcols()
1027 result->values[i].value = (char *)emalloc(displaysize + 1); in odbc_bindcols()
1028 rc = SQLBindCol(result->stmt, (SQLUSMALLINT)(i+1), SQL_C_CHAR, result->values[i].value, in odbc_bindcols()
1029 displaysize + 1, &result->values[i].vallen); in odbc_bindcols()
1074 odbc_result *result; in odbc_column_lengths() local
1093 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in odbc_column_lengths()
1095 if (result->numcols == 0) { in odbc_column_lengths()
1100 if (pv_num > result->numcols) { in odbc_column_lengths()
1110 …PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)pv_num, (SQLUSMALLINT) (type?SQL_COLUMN_SCALE… in odbc_column_lengths()
1183 odbc_result *result = NULL; in PHP_FUNCTION() local
1196 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
1198 result->numparams = 0; in PHP_FUNCTION()
1200 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
1202 efree(result); in PHP_FUNCTION()
1209 efree(result); in PHP_FUNCTION()
1218 if ((result->fetch_abs = (scrollopts & SQL_FD_FETCH_ABSOLUTE))) { in PHP_FUNCTION()
1222 SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, ODBCG(default_cursortype)); in PHP_FUNCTION()
1225 result->fetch_abs = 0; in PHP_FUNCTION()
1229 rc = SQLPrepare(result->stmt, query, SQL_NTS); in PHP_FUNCTION()
1234 odbc_sql_error(conn, result->stmt, "SQLPrepare"); in PHP_FUNCTION()
1237 odbc_sql_error(conn, result->stmt, "SQLPrepare"); in PHP_FUNCTION()
1241 SQLNumParams(result->stmt, &(result->numparams)); in PHP_FUNCTION()
1242 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1244 if (result->numcols > 0) { in PHP_FUNCTION()
1245 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
1246 efree(result); in PHP_FUNCTION()
1250 result->values = NULL; in PHP_FUNCTION()
1253 result->conn_ptr = conn; in PHP_FUNCTION()
1254 result->fetched = 0; in PHP_FUNCTION()
1255 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
1278 odbc_result *result; in PHP_FUNCTION() local
1288 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
1291 if (result->numparams > 0 && numArgs == 1) { in PHP_FUNCTION()
1296 if (result->numparams > 0) { in PHP_FUNCTION()
1297 if ((ne = zend_hash_num_elements(Z_ARRVAL_P(pv_param_arr))) < result->numparams) { in PHP_FUNCTION()
1298 …(NULL TSRMLS_CC, E_WARNING,"Not enough parameters (%d should be %d) given", ne, result->numparams); in PHP_FUNCTION()
1303 params = (params_t *)safe_emalloc(sizeof(params_t), result->numparams, 0); in PHP_FUNCTION()
1304 for(i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1308 for(i = 1; i <= result->numparams; i++) { in PHP_FUNCTION()
1311 SQLFreeStmt(result->stmt,SQL_RESET_PARAMS); in PHP_FUNCTION()
1312 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1325 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1326 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1335 rc = SQLDescribeParam(result->stmt, (SQLUSMALLINT)i, &sqltype, &precision, &scale, &nullable); in PHP_FUNCTION()
1339 odbc_sql_error(result->conn_ptr, result->stmt, "SQLDescribeParameter"); in PHP_FUNCTION()
1340 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1341 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1369 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1370 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1381 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1382 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1396 rc = SQLBindParameter(result->stmt, (SQLUSMALLINT)i, SQL_PARAM_INPUT, in PHP_FUNCTION()
1408 rc = SQLBindParameter(result->stmt, (SQLUSMALLINT)i, SQL_PARAM_INPUT, in PHP_FUNCTION()
1414 odbc_sql_error(result->conn_ptr, result->stmt, "SQLBindParameter"); in PHP_FUNCTION()
1415 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1416 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1428 rc = SQLFreeStmt(result->stmt, SQL_CLOSE); in PHP_FUNCTION()
1431 odbc_sql_error(result->conn_ptr, result->stmt, "SQLFreeStmt"); in PHP_FUNCTION()
1434 rc = SQLExecute(result->stmt); in PHP_FUNCTION()
1436 result->fetched = 0; in PHP_FUNCTION()
1441 rc = SQLParamData(result->stmt, (void*)&fp); in PHP_FUNCTION()
1444 SQLPutData(result->stmt, (void*)&buf, nbytes); in PHP_FUNCTION()
1454 odbc_sql_error(result->conn_ptr, result->stmt, "SQLExecute"); in PHP_FUNCTION()
1457 odbc_sql_error(result->conn_ptr, result->stmt, "SQLExecute"); in PHP_FUNCTION()
1462 if (result->numparams > 0) { in PHP_FUNCTION()
1463 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1464 for(i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1476 if (result->numcols == 0) { in PHP_FUNCTION()
1477 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1479 if (result->numcols > 0) { in PHP_FUNCTION()
1480 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
1481 efree(result); in PHP_FUNCTION()
1485 result->values = NULL; in PHP_FUNCTION()
1499 odbc_result *result; in PHP_FUNCTION() local
1506 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
1508 …rc = SQLGetInfo(result->conn_ptr->hdbc,SQL_MAX_CURSOR_NAME_LEN, (void *)&max_len,sizeof(max_len),&… in PHP_FUNCTION()
1515 rc = SQLGetCursorName(result->stmt,cursorname,(SQLSMALLINT)max_len,&len); in PHP_FUNCTION()
1522 SQLError( result->conn_ptr->henv, result->conn_ptr->hdbc, in PHP_FUNCTION()
1523 result->stmt, state, &error, errormsg, in PHP_FUNCTION()
1526 snprintf(cursorname, max_len+1, "php_curs_%d", (int)result->stmt); in PHP_FUNCTION()
1527 if (SQLSetCursorName(result->stmt,cursorname,SQL_NTS) != SQL_SUCCESS) { in PHP_FUNCTION()
1528 odbc_sql_error(result->conn_ptr, result->stmt, "SQLSetCursorName"); in PHP_FUNCTION()
1611 odbc_result *result = NULL; in PHP_FUNCTION() local
1626 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
1628 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
1631 efree(result); in PHP_FUNCTION()
1637 efree(result); in PHP_FUNCTION()
1646 if ((result->fetch_abs = (scrollopts & SQL_FD_FETCH_ABSOLUTE))) { in PHP_FUNCTION()
1650 SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, ODBCG(default_cursortype)); in PHP_FUNCTION()
1653 result->fetch_abs = 0; in PHP_FUNCTION()
1657 rc = SQLExecDirect(result->stmt, query, SQL_NTS); in PHP_FUNCTION()
1662 odbc_sql_error(conn, result->stmt, "SQLExecDirect"); in PHP_FUNCTION()
1663 SQLFreeStmt(result->stmt, SQL_DROP); in PHP_FUNCTION()
1664 efree(result); in PHP_FUNCTION()
1668 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1671 if (result->numcols > 0) { in PHP_FUNCTION()
1672 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
1673 efree(result); in PHP_FUNCTION()
1677 result->values = NULL; in PHP_FUNCTION()
1680 result->conn_ptr = conn; in PHP_FUNCTION()
1681 result->fetched = 0; in PHP_FUNCTION()
1682 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
1694 odbc_result *result; in php_odbc_fetch_hash() local
1718 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in php_odbc_fetch_hash()
1720 if (result->numcols == 0) { in php_odbc_fetch_hash()
1726 if (result->fetch_abs) { in php_odbc_fetch_hash()
1728 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in php_odbc_fetch_hash()
1730 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in php_odbc_fetch_hash()
1734 rc = SQLFetch(result->stmt); in php_odbc_fetch_hash()
1743 if (rownum > 0 && result->fetch_abs) in php_odbc_fetch_hash()
1744 result->fetched = rownum; in php_odbc_fetch_hash()
1747 result->fetched++; in php_odbc_fetch_hash()
1749 for(i = 0; i < result->numcols; i++) { in php_odbc_fetch_hash()
1755 switch(result->values[i].coltype) { in php_odbc_fetch_hash()
1759 if (result->binmode <= 0) { in php_odbc_fetch_hash()
1763 if (result->binmode == 1) { in php_odbc_fetch_hash()
1770 if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { in php_odbc_fetch_hash()
1775 buf = emalloc(result->longreadlen + 1); in php_odbc_fetch_hash()
1778 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1), sql_c_type, buf, result->longreadlen + 1, &re… in php_odbc_fetch_hash()
1781 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in php_odbc_fetch_hash()
1787 Z_STRLEN_P(tmp) = result->longreadlen; in php_odbc_fetch_hash()
1788 } else if (result->values[i].vallen == SQL_NULL_DATA) { in php_odbc_fetch_hash()
1792 Z_STRLEN_P(tmp) = result->values[i].vallen; in php_odbc_fetch_hash()
1798 if (result->values[i].vallen == SQL_NULL_DATA) { in php_odbc_fetch_hash()
1802 Z_STRLEN_P(tmp) = result->values[i].vallen; in php_odbc_fetch_hash()
1803 Z_STRVAL_P(tmp) = estrndup(result->values[i].value,Z_STRLEN_P(tmp)); in php_odbc_fetch_hash()
1810 if (!*(result->values[i].name) && Z_TYPE_P(tmp) == IS_STRING) { in php_odbc_fetch_hash()
1813 …zend_hash_update(Z_ARRVAL_P(return_value), result->values[i].name, strlen(result->values[i].name)+… in php_odbc_fetch_hash()
1849 odbc_result *result; in PHP_FUNCTION() local
1873 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
1875 if (result->numcols == 0) { in PHP_FUNCTION()
1885 if (result->fetch_abs) { in PHP_FUNCTION()
1887 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in PHP_FUNCTION()
1889 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
1893 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
1900 if (rownum > 0 && result->fetch_abs) in PHP_FUNCTION()
1901 result->fetched = rownum; in PHP_FUNCTION()
1904 result->fetched++; in PHP_FUNCTION()
1906 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
1912 switch(result->values[i].coltype) { in PHP_FUNCTION()
1916 if (result->binmode <= 0) { in PHP_FUNCTION()
1920 if (result->binmode == 1) sql_c_type = SQL_C_BINARY; in PHP_FUNCTION()
1926 if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { in PHP_FUNCTION()
1932 buf = emalloc(result->longreadlen + 1); in PHP_FUNCTION()
1934 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1),sql_c_type, buf, result->longreadlen + 1, &res… in PHP_FUNCTION()
1937 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
1942 Z_STRLEN_P(tmp) = result->longreadlen; in PHP_FUNCTION()
1943 } else if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
1947 Z_STRLEN_P(tmp) = result->values[i].vallen; in PHP_FUNCTION()
1953 if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
1957 Z_STRLEN_P(tmp) = result->values[i].vallen; in PHP_FUNCTION()
1958 Z_STRVAL_P(tmp) = estrndup(result->values[i].value,Z_STRLEN_P(tmp)); in PHP_FUNCTION()
1964 RETURN_LONG(result->numcols); in PHP_FUNCTION()
1973 odbc_result *result; in PHP_FUNCTION() local
1981 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
1982 if (result->numcols == 0) { in PHP_FUNCTION()
1986 rc = SQLFetchPrev(result->stmt); in PHP_FUNCTION()
1992 if (result->fetched > 1) { in PHP_FUNCTION()
1993 result->fetched--; in PHP_FUNCTION()
2006 odbc_result *result; in PHP_FUNCTION() local
2021 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2023 if (result->numcols == 0) { in PHP_FUNCTION()
2029 if (result->fetch_abs) { in PHP_FUNCTION()
2031 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in PHP_FUNCTION()
2033 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2037 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2044 result->fetched = rownum; in PHP_FUNCTION()
2046 result->fetched++; in PHP_FUNCTION()
2060 odbc_result *result; in PHP_FUNCTION() local
2084 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2086 if ((result->numcols == 0)) { in PHP_FUNCTION()
2093 if (result->values == NULL) { in PHP_FUNCTION()
2098 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2099 if (!strcasecmp(result->values[i].name, field)) { in PHP_FUNCTION()
2111 if (field_ind >= result->numcols || field_ind < 0) { in PHP_FUNCTION()
2117 if (result->fetched == 0) { in PHP_FUNCTION()
2120 if (result->fetch_abs) in PHP_FUNCTION()
2121 rc = SQLExtendedFetch(result->stmt, SQL_FETCH_NEXT, 1, &crow,RowStatus); in PHP_FUNCTION()
2124 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2130 result->fetched++; in PHP_FUNCTION()
2133 switch(result->values[field_ind].coltype) { in PHP_FUNCTION()
2137 if (result->binmode <= 1) { in PHP_FUNCTION()
2140 if (result->binmode <= 0) { in PHP_FUNCTION()
2147 if (IS_SQL_LONG(result->values[field_ind].coltype)) { in PHP_FUNCTION()
2148 if (result->longreadlen <= 0) { in PHP_FUNCTION()
2151 fieldsize = result->longreadlen; in PHP_FUNCTION()
2154 PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(field_ind + 1), in PHP_FUNCTION()
2160 fieldsize = (result->longreadlen <= 0) ? 4096 : result->longreadlen; in PHP_FUNCTION()
2166 rc = SQLGetData(result->stmt, (SQLUSMALLINT)(field_ind + 1), sql_c_type, in PHP_FUNCTION()
2167 field, fieldsize, &result->values[field_ind].vallen); 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()
2184 if ((result->values[field_ind].coltype == SQL_LONGVARCHAR) in PHP_FUNCTION()
2186 || (result->values[field_ind].coltype == SQL_WLONGVARCHAR) in PHP_FUNCTION()
2194 …RETURN_STRINGL(field, (rc == SQL_SUCCESS_WITH_INFO) ? fieldsize : result->values[field_ind].vallen… in PHP_FUNCTION()
2198 if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2201 RETURN_STRINGL(result->values[field_ind].value, result->values[field_ind].vallen, 1); in PHP_FUNCTION()
2214 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(field_ind + 1),sql_c_type, field, fieldsize, &result-… in PHP_FUNCTION()
2217 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2222 if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2227 PHPWRITE(field,(rc == SQL_SUCCESS_WITH_INFO) ? 4095 : result->values[field_ind].vallen); in PHP_FUNCTION()
2243 odbc_result *result; in PHP_FUNCTION() local
2258 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2260 if (result->numcols == 0) { in PHP_FUNCTION()
2265 if (result->fetch_abs) in PHP_FUNCTION()
2266 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2269 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2283 for (i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2284 php_printf("<th>%s</th>", result->values[i].name); in PHP_FUNCTION()
2290 result->fetched++; in PHP_FUNCTION()
2292 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2294 switch(result->values[i].coltype) { in PHP_FUNCTION()
2298 if (result->binmode <= 0) { in PHP_FUNCTION()
2302 if (result->binmode <= 1) sql_c_type = SQL_C_BINARY; in PHP_FUNCTION()
2307 if (IS_SQL_LONG(result->values[i].coltype) && in PHP_FUNCTION()
2308 result->longreadlen <= 0) { in PHP_FUNCTION()
2314 buf = emalloc(result->longreadlen); in PHP_FUNCTION()
2317 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1),sql_c_type, buf, result->longreadlen, &result-… in PHP_FUNCTION()
2322 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2328 PHPWRITE(buf, result->longreadlen); in PHP_FUNCTION()
2329 } else if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2333 PHPWRITE(buf, result->values[i].vallen); in PHP_FUNCTION()
2338 if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2341 php_printf("<td>%s</td>", result->values[i].value); in PHP_FUNCTION()
2349 if (result->fetch_abs) in PHP_FUNCTION()
2350 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2353 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2357 RETURN_LONG(result->fetched); in PHP_FUNCTION()
2366 odbc_result *result; in PHP_FUNCTION() local
2373 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2374 if (result->values) { in PHP_FUNCTION()
2375 for (i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2376 if (result->values[i].value) { in PHP_FUNCTION()
2377 efree(result->values[i].value); in PHP_FUNCTION()
2380 efree(result->values); in PHP_FUNCTION()
2381 result->values = NULL; in PHP_FUNCTION()
2748 odbc_result *result; in PHP_FUNCTION() local
2755 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2756 SQLRowCount(result->stmt, &rows); in PHP_FUNCTION()
2766 odbc_result *result; in PHP_FUNCTION() local
2773 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2775 if (result->values) { in PHP_FUNCTION()
2776 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2777 if (result->values[i].value) { in PHP_FUNCTION()
2778 efree(result->values[i].value); in PHP_FUNCTION()
2781 efree(result->values); in PHP_FUNCTION()
2782 result->values = NULL; in PHP_FUNCTION()
2785 result->fetched = 0; in PHP_FUNCTION()
2786 rc = SQLMoreResults(result->stmt); in PHP_FUNCTION()
2788 rc = SQLFreeStmt(result->stmt, SQL_UNBIND); in PHP_FUNCTION()
2789 SQLNumParams(result->stmt, &(result->numparams)); in PHP_FUNCTION()
2790 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
2792 if (result->numcols > 0) { in PHP_FUNCTION()
2793 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
2794 efree(result); in PHP_FUNCTION()
2798 result->values = NULL; in PHP_FUNCTION()
2804 odbc_sql_error(result->conn_ptr, result->stmt, "SQLMoreResults"); in PHP_FUNCTION()
2815 odbc_result *result; in PHP_FUNCTION() local
2821 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2822 RETURN_LONG(result->numcols); in PHP_FUNCTION()
2830 odbc_result *result; in PHP_FUNCTION() local
2838 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2840 if (result->numcols == 0) { in PHP_FUNCTION()
2845 if (pv_num > result->numcols) { in PHP_FUNCTION()
2855 RETURN_STRING(result->values[pv_num - 1].name, 1); in PHP_FUNCTION()
2863 odbc_result *result; in PHP_FUNCTION() local
2873 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2875 if (result->numcols == 0) { in PHP_FUNCTION()
2880 if (pv_num > result->numcols) { in PHP_FUNCTION()
2890 …PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)pv_num, SQL_COLUMN_TYPE_NAME, tmp, 31, &tmple… in PHP_FUNCTION()
2917 odbc_result *result; in PHP_FUNCTION() local
2924 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result); in PHP_FUNCTION()
2926 if (result->numcols == 0) { in PHP_FUNCTION()
2932 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2933 if (strcasecmp(result->values[i].name, fname) == 0) { in PHP_FUNCTION()
3062 odbc_result *result; in PHP_FUNCTION() local
3086 ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_handle, -1, "ODBC result", le_result); in PHP_FUNCTION()
3088 rc = SQLSetStmtOption(result->stmt, (unsigned short) pv_opt, pv_val); in PHP_FUNCTION()
3091 odbc_sql_error(result->conn_ptr, result->stmt, "SetStmtOption"); in PHP_FUNCTION()
3114 odbc_result *result = NULL; in PHP_FUNCTION() local
3127 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3129 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3131 efree(result); in PHP_FUNCTION()
3138 efree(result); in PHP_FUNCTION()
3147 rc = SQLTables(result->stmt, in PHP_FUNCTION()
3155 efree(result); in PHP_FUNCTION()
3159 result->numparams = 0; in PHP_FUNCTION()
3160 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3162 if (result->numcols > 0) { in PHP_FUNCTION()
3163 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3164 efree(result); in PHP_FUNCTION()
3168 result->values = NULL; in PHP_FUNCTION()
3170 result->conn_ptr = conn; in PHP_FUNCTION()
3171 result->fetched = 0; in PHP_FUNCTION()
3172 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3181 odbc_result *result = NULL; in PHP_FUNCTION() local
3194 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3196 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3198 efree(result); in PHP_FUNCTION()
3205 efree(result); in PHP_FUNCTION()
3216 rc = SQLColumns(result->stmt, in PHP_FUNCTION()
3224 efree(result); in PHP_FUNCTION()
3228 result->numparams = 0; in PHP_FUNCTION()
3229 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3231 if (result->numcols > 0) { in PHP_FUNCTION()
3232 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3233 efree(result); in PHP_FUNCTION()
3237 result->values = NULL; in PHP_FUNCTION()
3239 result->conn_ptr = conn; in PHP_FUNCTION()
3240 result->fetched = 0; in PHP_FUNCTION()
3241 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3251 odbc_result *result = NULL; in PHP_FUNCTION() local
3264 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3266 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3268 efree(result); in PHP_FUNCTION()
3275 efree(result); in PHP_FUNCTION()
3279 rc = SQLColumnPrivileges(result->stmt, in PHP_FUNCTION()
3287 efree(result); in PHP_FUNCTION()
3291 result->numparams = 0; in PHP_FUNCTION()
3292 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3294 if (result->numcols > 0) { in PHP_FUNCTION()
3295 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3296 efree(result); in PHP_FUNCTION()
3300 result->values = NULL; in PHP_FUNCTION()
3302 result->conn_ptr = conn; in PHP_FUNCTION()
3303 result->fetched = 0; in PHP_FUNCTION()
3304 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3315 odbc_result *result = NULL; in PHP_FUNCTION() local
3340 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3342 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3344 efree(result); in PHP_FUNCTION()
3351 efree(result); in PHP_FUNCTION()
3355 rc = SQLForeignKeys(result->stmt, in PHP_FUNCTION()
3365 efree(result); in PHP_FUNCTION()
3369 result->numparams = 0; in PHP_FUNCTION()
3370 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3372 if (result->numcols > 0) { in PHP_FUNCTION()
3373 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3374 efree(result); in PHP_FUNCTION()
3378 result->values = NULL; in PHP_FUNCTION()
3380 result->conn_ptr = conn; in PHP_FUNCTION()
3381 result->fetched = 0; in PHP_FUNCTION()
3382 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3393 odbc_result *result = NULL; in PHP_FUNCTION() local
3406 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3408 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3410 efree(result); in PHP_FUNCTION()
3417 efree(result); in PHP_FUNCTION()
3421 rc = SQLGetTypeInfo(result->stmt, data_type ); in PHP_FUNCTION()
3425 efree(result); in PHP_FUNCTION()
3429 result->numparams = 0; in PHP_FUNCTION()
3430 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3432 if (result->numcols > 0) { in PHP_FUNCTION()
3433 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3434 efree(result); in PHP_FUNCTION()
3438 result->values = NULL; in PHP_FUNCTION()
3440 result->conn_ptr = conn; in PHP_FUNCTION()
3441 result->fetched = 0; in PHP_FUNCTION()
3442 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3451 odbc_result *result = NULL; in PHP_FUNCTION() local
3463 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3465 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3467 efree(result); in PHP_FUNCTION()
3474 efree(result); in PHP_FUNCTION()
3478 rc = SQLPrimaryKeys(result->stmt, in PHP_FUNCTION()
3485 efree(result); in PHP_FUNCTION()
3489 result->numparams = 0; in PHP_FUNCTION()
3490 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3492 if (result->numcols > 0) { in PHP_FUNCTION()
3493 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3494 efree(result); in PHP_FUNCTION()
3498 result->values = NULL; in PHP_FUNCTION()
3500 result->conn_ptr = conn; in PHP_FUNCTION()
3501 result->fetched = 0; in PHP_FUNCTION()
3502 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3512 odbc_result *result = NULL; in PHP_FUNCTION() local
3529 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3531 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3533 efree(result); in PHP_FUNCTION()
3540 efree(result); in PHP_FUNCTION()
3544 rc = SQLProcedureColumns(result->stmt, in PHP_FUNCTION()
3552 efree(result); in PHP_FUNCTION()
3556 result->numparams = 0; in PHP_FUNCTION()
3557 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3559 if (result->numcols > 0) { in PHP_FUNCTION()
3560 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3561 efree(result); in PHP_FUNCTION()
3565 result->values = NULL; in PHP_FUNCTION()
3567 result->conn_ptr = conn; in PHP_FUNCTION()
3568 result->fetched = 0; in PHP_FUNCTION()
3569 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3580 odbc_result *result = NULL; in PHP_FUNCTION() local
3596 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3598 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3600 efree(result); in PHP_FUNCTION()
3607 efree(result); in PHP_FUNCTION()
3611 rc = SQLProcedures(result->stmt, in PHP_FUNCTION()
3618 efree(result); in PHP_FUNCTION()
3622 result->numparams = 0; in PHP_FUNCTION()
3623 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3625 if (result->numcols > 0) { in PHP_FUNCTION()
3626 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3627 efree(result); in PHP_FUNCTION()
3631 result->values = NULL; in PHP_FUNCTION()
3633 result->conn_ptr = conn; in PHP_FUNCTION()
3634 result->fetched = 0; in PHP_FUNCTION()
3635 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3646 odbc_result *result = NULL; in PHP_FUNCTION() local
3664 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3666 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3668 efree(result); in PHP_FUNCTION()
3675 efree(result); in PHP_FUNCTION()
3679 rc = SQLSpecialColumns(result->stmt, in PHP_FUNCTION()
3689 efree(result); in PHP_FUNCTION()
3693 result->numparams = 0; in PHP_FUNCTION()
3694 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3696 if (result->numcols > 0) { in PHP_FUNCTION()
3697 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3698 efree(result); in PHP_FUNCTION()
3702 result->values = NULL; in PHP_FUNCTION()
3704 result->conn_ptr = conn; in PHP_FUNCTION()
3705 result->fetched = 0; in PHP_FUNCTION()
3706 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3716 odbc_result *result = NULL; in PHP_FUNCTION() local
3733 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3735 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3737 efree(result); in PHP_FUNCTION()
3744 efree(result); in PHP_FUNCTION()
3748 rc = SQLStatistics(result->stmt, in PHP_FUNCTION()
3757 efree(result); in PHP_FUNCTION()
3761 result->numparams = 0; in PHP_FUNCTION()
3762 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3764 if (result->numcols > 0) { in PHP_FUNCTION()
3765 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3766 efree(result); in PHP_FUNCTION()
3770 result->values = NULL; in PHP_FUNCTION()
3772 result->conn_ptr = conn; in PHP_FUNCTION()
3773 result->fetched = 0; in PHP_FUNCTION()
3774 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()
3784 odbc_result *result = NULL; in PHP_FUNCTION() local
3796 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3798 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3800 efree(result); in PHP_FUNCTION()
3807 efree(result); in PHP_FUNCTION()
3811 rc = SQLTablePrivileges(result->stmt, in PHP_FUNCTION()
3818 efree(result); in PHP_FUNCTION()
3822 result->numparams = 0; in PHP_FUNCTION()
3823 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3825 if (result->numcols > 0) { in PHP_FUNCTION()
3826 if (!odbc_bindcols(result TSRMLS_CC)) { in PHP_FUNCTION()
3827 efree(result); in PHP_FUNCTION()
3831 result->values = NULL; in PHP_FUNCTION()
3833 result->conn_ptr = conn; in PHP_FUNCTION()
3834 result->fetched = 0; in PHP_FUNCTION()
3835 ZEND_REGISTER_RESOURCE(return_value, result, le_result); in PHP_FUNCTION()