Lines Matching refs:result
112 ZEND_ARG_INFO(0, result)
117 ZEND_ARG_INFO(0, result)
922 odbc_result *result; in php_odbc_fetch_attribs() local
930 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in php_odbc_fetch_attribs()
935 result->longreadlen = flag; in php_odbc_fetch_attribs()
937 result->binmode = flag; in php_odbc_fetch_attribs()
945 int odbc_bindcols(odbc_result *result) in odbc_bindcols() argument
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()
1011 …if (SQL_SUCCESS == SQLGetDiagRec(SQL_HANDLE_STMT, result->stmt, 1, state, &err, errtxt, 128, NULL)… in odbc_bindcols()
1019 rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_DISPLAY_SIZE, in odbc_bindcols()
1024 if (result->values[i].coltype == SQL_WVARCHAR && displaysize == 0) { in odbc_bindcols()
1025 result->values[i].coltype = SQL_WLONGVARCHAR; in odbc_bindcols()
1026 result->values[i].value = NULL; in odbc_bindcols()
1031 if (SQL_VARCHAR == result->values[i].coltype && displaysize == 0) { in odbc_bindcols()
1032 result->values[i].coltype = SQL_LONGVARCHAR; in odbc_bindcols()
1033 result->values[i].value = NULL; in odbc_bindcols()
1038 if (result->values[i].coltype == SQL_TIMESTAMP) { in odbc_bindcols()
1046 result->values[i].value = (char *)emalloc(displaysize + 1); in odbc_bindcols()
1047 rc = SQLBindCol(result->stmt, (SQLUSMALLINT)(i+1), SQL_C_CHAR, result->values[i].value, in odbc_bindcols()
1048 displaysize + 1, &result->values[i].vallen); in odbc_bindcols()
1095 odbc_result *result; in odbc_column_lengths() local
1114 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in odbc_column_lengths()
1118 if (result->numcols == 0) { in odbc_column_lengths()
1123 if (pv_num > result->numcols) { in odbc_column_lengths()
1133 …PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)pv_num, (SQLUSMALLINT) (type?SQL_COLUMN_SCALE… in odbc_column_lengths()
1197 odbc_result *result = NULL; in PHP_FUNCTION() local
1213 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
1215 result->numparams = 0; in PHP_FUNCTION()
1216 result->param_info = NULL; in PHP_FUNCTION()
1218 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
1220 efree(result); in PHP_FUNCTION()
1227 efree(result); in PHP_FUNCTION()
1236 if ((result->fetch_abs = (scrollopts & SQL_FD_FETCH_ABSOLUTE))) { in PHP_FUNCTION()
1240 SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, ODBCG(default_cursortype)); in PHP_FUNCTION()
1243 result->fetch_abs = 0; in PHP_FUNCTION()
1247 rc = SQLPrepare(result->stmt, query, SQL_NTS); in PHP_FUNCTION()
1252 odbc_sql_error(conn, result->stmt, "SQLPrepare"); in PHP_FUNCTION()
1255 odbc_sql_error(conn, result->stmt, "SQLPrepare"); in PHP_FUNCTION()
1259 SQLNumParams(result->stmt, &(result->numparams)); in PHP_FUNCTION()
1260 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1262 if (result->numcols > 0) { in PHP_FUNCTION()
1263 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
1264 efree(result); in PHP_FUNCTION()
1268 result->values = NULL; in PHP_FUNCTION()
1271 result->conn_ptr = conn; in PHP_FUNCTION()
1272 result->fetched = 0; in PHP_FUNCTION()
1274 …result->param_info = (odbc_param_info *) safe_emalloc(sizeof(odbc_param_info), result->numparams, … in PHP_FUNCTION()
1275 for (i=0;i<result->numparams;i++) { in PHP_FUNCTION()
1276 …rc = SQLDescribeParam(result->stmt, (SQLUSMALLINT)(i+1), &result->param_info[i].sqltype, &result->… in PHP_FUNCTION()
1277 &result->param_info[i].scale, &result->param_info[i].nullable); in PHP_FUNCTION()
1279 odbc_sql_error(result->conn_ptr, result->stmt, "SQLDescribeParameter"); in PHP_FUNCTION()
1280 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1281 efree(result->param_info); in PHP_FUNCTION()
1282 efree(result); in PHP_FUNCTION()
1287 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
1308 odbc_result *result; in PHP_FUNCTION() local
1318 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
1323 if (result->numparams > 0 && numArgs == 1) { in PHP_FUNCTION()
1328 if (result->numparams > 0) { in PHP_FUNCTION()
1329 if ((ne = zend_hash_num_elements(Z_ARRVAL_P(pv_param_arr))) < result->numparams) { in PHP_FUNCTION()
1330 …php_error_docref(NULL, E_WARNING,"Not enough parameters (%d should be %d) given", ne, result->nump… in PHP_FUNCTION()
1335 params = (params_t *)safe_emalloc(sizeof(params_t), result->numparams, 0); in PHP_FUNCTION()
1336 for(i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1340 for(i = 1; i <= result->numparams; i++) { in PHP_FUNCTION()
1343 SQLFreeStmt(result->stmt,SQL_RESET_PARAMS); in PHP_FUNCTION()
1344 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1357 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1358 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1370 if (IS_SQL_BINARY(result->param_info[i-1].sqltype)) { in PHP_FUNCTION()
1389 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1390 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1401 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1402 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1416 rc = SQLBindParameter(result->stmt, (SQLUSMALLINT)i, SQL_PARAM_INPUT, in PHP_FUNCTION()
1417 …ctype, result->param_info[i-1].sqltype, result->param_info[i-1].precision, result->param_info[i-1]… in PHP_FUNCTION()
1428 rc = SQLBindParameter(result->stmt, (SQLUSMALLINT)i, SQL_PARAM_INPUT, in PHP_FUNCTION()
1429 …ctype, result->param_info[i-1].sqltype, result->param_info[i-1].precision, result->param_info[i-1]… in PHP_FUNCTION()
1434 odbc_sql_error(result->conn_ptr, result->stmt, "SQLBindParameter"); in PHP_FUNCTION()
1435 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1436 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1448 rc = SQLFreeStmt(result->stmt, SQL_CLOSE); in PHP_FUNCTION()
1451 odbc_sql_error(result->conn_ptr, result->stmt, "SQLFreeStmt"); in PHP_FUNCTION()
1454 rc = SQLExecute(result->stmt); in PHP_FUNCTION()
1456 result->fetched = 0; in PHP_FUNCTION()
1461 rc = SQLParamData(result->stmt, (void*)&fp); in PHP_FUNCTION()
1464 SQLPutData(result->stmt, (void*)&buf, nbytes); in PHP_FUNCTION()
1474 odbc_sql_error(result->conn_ptr, result->stmt, "SQLExecute"); in PHP_FUNCTION()
1477 odbc_sql_error(result->conn_ptr, result->stmt, "SQLExecute"); in PHP_FUNCTION()
1482 if (result->numparams > 0) { in PHP_FUNCTION()
1483 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1484 for(i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1496 if (result->numcols == 0) { in PHP_FUNCTION()
1497 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1499 if (result->numcols > 0) { in PHP_FUNCTION()
1500 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
1501 efree(result); in PHP_FUNCTION()
1505 result->values = NULL; in PHP_FUNCTION()
1519 odbc_result *result; in PHP_FUNCTION() local
1526 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
1530 …rc = SQLGetInfo(result->conn_ptr->hdbc,SQL_MAX_CURSOR_NAME_LEN, (void *)&max_len,sizeof(max_len),&… in PHP_FUNCTION()
1537 rc = SQLGetCursorName(result->stmt,cursorname,(SQLSMALLINT)max_len,&len); in PHP_FUNCTION()
1544 SQLError( result->conn_ptr->henv, result->conn_ptr->hdbc, in PHP_FUNCTION()
1545 result->stmt, state, &error, errormsg, in PHP_FUNCTION()
1548 snprintf(cursorname, max_len+1, "php_curs_" ZEND_ULONG_FMT, (zend_ulong)result->stmt); in PHP_FUNCTION()
1549 if (SQLSetCursorName(result->stmt,cursorname,SQL_NTS) != SQL_SUCCESS) { in PHP_FUNCTION()
1550 odbc_sql_error(result->conn_ptr, result->stmt, "SQLSetCursorName"); in PHP_FUNCTION()
1636 odbc_result *result = NULL; in PHP_FUNCTION() local
1653 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
1655 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
1658 efree(result); in PHP_FUNCTION()
1664 efree(result); in PHP_FUNCTION()
1673 if ((result->fetch_abs = (scrollopts & SQL_FD_FETCH_ABSOLUTE))) { in PHP_FUNCTION()
1677 SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, ODBCG(default_cursortype)); in PHP_FUNCTION()
1680 result->fetch_abs = 0; in PHP_FUNCTION()
1684 rc = SQLExecDirect(result->stmt, query, SQL_NTS); in PHP_FUNCTION()
1689 odbc_sql_error(conn, result->stmt, "SQLExecDirect"); in PHP_FUNCTION()
1690 SQLFreeStmt(result->stmt, SQL_DROP); in PHP_FUNCTION()
1691 efree(result); in PHP_FUNCTION()
1695 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1698 if (result->numcols > 0) { in PHP_FUNCTION()
1699 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
1700 efree(result); in PHP_FUNCTION()
1704 result->values = NULL; in PHP_FUNCTION()
1707 result->conn_ptr = conn; in PHP_FUNCTION()
1708 result->fetched = 0; in PHP_FUNCTION()
1709 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
1721 odbc_result *result; in php_odbc_fetch_hash() local
1745 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in php_odbc_fetch_hash()
1749 if (result->numcols == 0) { in php_odbc_fetch_hash()
1755 if (result->fetch_abs) { in php_odbc_fetch_hash()
1757 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in php_odbc_fetch_hash()
1759 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in php_odbc_fetch_hash()
1763 rc = SQLFetch(result->stmt); in php_odbc_fetch_hash()
1772 if (rownum > 0 && result->fetch_abs) in php_odbc_fetch_hash()
1773 result->fetched = rownum; in php_odbc_fetch_hash()
1776 result->fetched++; in php_odbc_fetch_hash()
1778 for(i = 0; i < result->numcols; i++) { in php_odbc_fetch_hash()
1781 switch(result->values[i].coltype) { in php_odbc_fetch_hash()
1785 if (result->binmode <= 0) { in php_odbc_fetch_hash()
1789 if (result->binmode == 1) { in php_odbc_fetch_hash()
1796 if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { in php_odbc_fetch_hash()
1801 buf = emalloc(result->longreadlen + 1); in php_odbc_fetch_hash()
1804 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1), sql_c_type, buf, result->longreadlen + 1, &re… in php_odbc_fetch_hash()
1807 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in php_odbc_fetch_hash()
1813 ZVAL_STRINGL(&tmp, buf, result->longreadlen); in php_odbc_fetch_hash()
1814 } else if (result->values[i].vallen == SQL_NULL_DATA) { in php_odbc_fetch_hash()
1818 ZVAL_STRINGL(&tmp, buf, result->values[i].vallen); in php_odbc_fetch_hash()
1823 if (result->values[i].vallen == SQL_NULL_DATA) { in php_odbc_fetch_hash()
1827 ZVAL_STRINGL(&tmp, result->values[i].value, result->values[i].vallen); in php_odbc_fetch_hash()
1834 if (!*(result->values[i].name) && Z_TYPE(tmp) == IS_STRING) { in php_odbc_fetch_hash()
1837 …zend_hash_str_update(Z_ARRVAL_P(return_value), result->values[i].name, strlen(result->values[i].na… in php_odbc_fetch_hash()
1873 odbc_result *result; in PHP_FUNCTION() local
1897 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
1901 if (result->numcols == 0) { in PHP_FUNCTION()
1911 if (result->fetch_abs) { in PHP_FUNCTION()
1913 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in PHP_FUNCTION()
1915 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
1919 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
1926 if (rownum > 0 && result->fetch_abs) in PHP_FUNCTION()
1927 result->fetched = rownum; in PHP_FUNCTION()
1930 result->fetched++; in PHP_FUNCTION()
1932 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
1935 switch(result->values[i].coltype) { in PHP_FUNCTION()
1939 if (result->binmode <= 0) { in PHP_FUNCTION()
1943 if (result->binmode == 1) sql_c_type = SQL_C_BINARY; in PHP_FUNCTION()
1949 if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { in PHP_FUNCTION()
1955 buf = emalloc(result->longreadlen + 1); in PHP_FUNCTION()
1957 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1),sql_c_type, buf, result->longreadlen + 1, &res… in PHP_FUNCTION()
1960 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
1965 ZVAL_STRINGL(&tmp, buf, result->longreadlen); in PHP_FUNCTION()
1966 } else if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
1970 ZVAL_STRINGL(&tmp, buf, result->values[i].vallen); in PHP_FUNCTION()
1975 if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
1979 ZVAL_STRINGL(&tmp, result->values[i].value, result->values[i].vallen); in PHP_FUNCTION()
1985 RETURN_LONG(result->numcols); in PHP_FUNCTION()
1994 odbc_result *result; in PHP_FUNCTION() local
2002 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2005 if (result->numcols == 0) { in PHP_FUNCTION()
2009 rc = SQLFetchPrev(result->stmt); in PHP_FUNCTION()
2015 if (result->fetched > 1) { in PHP_FUNCTION()
2016 result->fetched--; in PHP_FUNCTION()
2029 odbc_result *result; in PHP_FUNCTION() local
2044 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2048 if (result->numcols == 0) { in PHP_FUNCTION()
2054 if (result->fetch_abs) { in PHP_FUNCTION()
2056 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in PHP_FUNCTION()
2058 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2062 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2069 result->fetched = rownum; in PHP_FUNCTION()
2071 result->fetched++; in PHP_FUNCTION()
2086 odbc_result *result; in PHP_FUNCTION() local
2110 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2114 if ((result->numcols == 0)) { in PHP_FUNCTION()
2121 if (result->values == NULL) { in PHP_FUNCTION()
2126 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2127 if (!strcasecmp(result->values[i].name, field)) { in PHP_FUNCTION()
2139 if (field_ind >= result->numcols || field_ind < 0) { in PHP_FUNCTION()
2145 if (result->fetched == 0) { in PHP_FUNCTION()
2148 if (result->fetch_abs) in PHP_FUNCTION()
2149 rc = SQLExtendedFetch(result->stmt, SQL_FETCH_NEXT, 1, &crow,RowStatus); in PHP_FUNCTION()
2152 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2158 result->fetched++; in PHP_FUNCTION()
2161 switch(result->values[field_ind].coltype) { in PHP_FUNCTION()
2165 if (result->binmode <= 1) { in PHP_FUNCTION()
2168 if (result->binmode <= 0) { in PHP_FUNCTION()
2175 if (IS_SQL_LONG(result->values[field_ind].coltype)) { in PHP_FUNCTION()
2176 if (result->longreadlen <= 0) { in PHP_FUNCTION()
2179 fieldsize = result->longreadlen; in PHP_FUNCTION()
2182 PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(field_ind + 1), in PHP_FUNCTION()
2188 fieldsize = (result->longreadlen <= 0) ? 4096 : result->longreadlen; in PHP_FUNCTION()
2194 rc = SQLGetData(result->stmt, (SQLUSMALLINT)(field_ind + 1), sql_c_type, in PHP_FUNCTION()
2195 ZSTR_VAL(field_str), fieldsize, &result->values[field_ind].vallen); in PHP_FUNCTION()
2198 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2203 if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2212 if ((result->values[field_ind].coltype == SQL_LONGVARCHAR) in PHP_FUNCTION()
2214 || (result->values[field_ind].coltype == SQL_WLONGVARCHAR) in PHP_FUNCTION()
2223 field_str = zend_string_truncate(field_str, result->values[field_ind].vallen, 0); in PHP_FUNCTION()
2229 if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2232 RETURN_STRINGL(result->values[field_ind].value, result->values[field_ind].vallen); in PHP_FUNCTION()
2245 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(field_ind + 1),sql_c_type, field, fieldsize, &result-… in PHP_FUNCTION()
2248 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2253 if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2258 PHPWRITE(field,(rc == SQL_SUCCESS_WITH_INFO) ? 4095 : result->values[field_ind].vallen); in PHP_FUNCTION()
2274 odbc_result *result; in PHP_FUNCTION() local
2289 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2293 if (result->numcols == 0) { in PHP_FUNCTION()
2298 if (result->fetch_abs) in PHP_FUNCTION()
2299 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2302 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2316 for (i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2317 php_printf("<th>%s</th>", result->values[i].name); in PHP_FUNCTION()
2323 result->fetched++; in PHP_FUNCTION()
2325 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2327 switch(result->values[i].coltype) { in PHP_FUNCTION()
2331 if (result->binmode <= 0) { in PHP_FUNCTION()
2335 if (result->binmode <= 1) sql_c_type = SQL_C_BINARY; in PHP_FUNCTION()
2340 if (IS_SQL_LONG(result->values[i].coltype) && in PHP_FUNCTION()
2341 result->longreadlen <= 0) { in PHP_FUNCTION()
2347 buf = emalloc(result->longreadlen); in PHP_FUNCTION()
2350 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1),sql_c_type, buf, result->longreadlen, &result-… in PHP_FUNCTION()
2355 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2361 PHPWRITE(buf, result->longreadlen); in PHP_FUNCTION()
2362 } else if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2366 PHPWRITE(buf, result->values[i].vallen); in PHP_FUNCTION()
2371 if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2374 php_printf("<td>%s</td>", result->values[i].value); in PHP_FUNCTION()
2382 if (result->fetch_abs) in PHP_FUNCTION()
2383 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2386 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2390 RETURN_LONG(result->fetched); in PHP_FUNCTION()
2399 odbc_result *result; in PHP_FUNCTION() local
2406 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2410 if (result->values) { in PHP_FUNCTION()
2411 for (i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2412 if (result->values[i].value) { in PHP_FUNCTION()
2413 efree(result->values[i].value); in PHP_FUNCTION()
2416 efree(result->values); in PHP_FUNCTION()
2417 result->values = NULL; in PHP_FUNCTION()
2781 odbc_result *result; in PHP_FUNCTION() local
2789 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2793 SQLRowCount(result->stmt, &rows); in PHP_FUNCTION()
2803 odbc_result *result; in PHP_FUNCTION() local
2811 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2815 if (result->values) { in PHP_FUNCTION()
2816 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2817 if (result->values[i].value) { in PHP_FUNCTION()
2818 efree(result->values[i].value); in PHP_FUNCTION()
2821 efree(result->values); in PHP_FUNCTION()
2822 result->values = NULL; in PHP_FUNCTION()
2825 result->fetched = 0; in PHP_FUNCTION()
2826 rc = SQLMoreResults(result->stmt); in PHP_FUNCTION()
2828 rc = SQLFreeStmt(result->stmt, SQL_UNBIND); in PHP_FUNCTION()
2829 SQLNumParams(result->stmt, &(result->numparams)); in PHP_FUNCTION()
2830 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
2832 if (result->numcols > 0) { in PHP_FUNCTION()
2833 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
2834 efree(result); in PHP_FUNCTION()
2838 result->values = NULL; in PHP_FUNCTION()
2844 odbc_sql_error(result->conn_ptr, result->stmt, "SQLMoreResults"); in PHP_FUNCTION()
2855 odbc_result *result; in PHP_FUNCTION() local
2862 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2866 RETURN_LONG(result->numcols); in PHP_FUNCTION()
2874 odbc_result *result; in PHP_FUNCTION() local
2882 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2886 if (result->numcols == 0) { in PHP_FUNCTION()
2891 if (pv_num > result->numcols) { in PHP_FUNCTION()
2901 RETURN_STRING(result->values[pv_num - 1].name); in PHP_FUNCTION()
2909 odbc_result *result; in PHP_FUNCTION() local
2919 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2923 if (result->numcols == 0) { in PHP_FUNCTION()
2928 if (pv_num > result->numcols) { in PHP_FUNCTION()
2938 …PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)pv_num, SQL_COLUMN_TYPE_NAME, tmp, 31, &tmple… in PHP_FUNCTION()
2965 odbc_result *result; in PHP_FUNCTION() local
2972 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2976 if (result->numcols == 0) { in PHP_FUNCTION()
2982 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2983 if (strcasecmp(result->values[i].name, fname) == 0) { in PHP_FUNCTION()
3108 odbc_result *result; in PHP_FUNCTION() local
3134 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_handle), "ODBC result", le_result)) ==… in PHP_FUNCTION()
3138 rc = SQLSetStmtOption(result->stmt, (unsigned short) pv_opt, pv_val); in PHP_FUNCTION()
3141 odbc_sql_error(result->conn_ptr, result->stmt, "SetStmtOption"); in PHP_FUNCTION()
3164 odbc_result *result = NULL; in PHP_FUNCTION() local
3179 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3181 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3183 efree(result); in PHP_FUNCTION()
3190 efree(result); in PHP_FUNCTION()
3199 rc = SQLTables(result->stmt, in PHP_FUNCTION()
3207 efree(result); in PHP_FUNCTION()
3211 result->numparams = 0; in PHP_FUNCTION()
3212 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3214 if (result->numcols > 0) { in PHP_FUNCTION()
3215 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3216 efree(result); in PHP_FUNCTION()
3220 result->values = NULL; in PHP_FUNCTION()
3222 result->conn_ptr = conn; in PHP_FUNCTION()
3223 result->fetched = 0; in PHP_FUNCTION()
3224 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3233 odbc_result *result = NULL; in PHP_FUNCTION() local
3248 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3250 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3252 efree(result); in PHP_FUNCTION()
3259 efree(result); in PHP_FUNCTION()
3270 rc = SQLColumns(result->stmt, in PHP_FUNCTION()
3278 efree(result); in PHP_FUNCTION()
3282 result->numparams = 0; in PHP_FUNCTION()
3283 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3285 if (result->numcols > 0) { in PHP_FUNCTION()
3286 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3287 efree(result); in PHP_FUNCTION()
3291 result->values = NULL; in PHP_FUNCTION()
3293 result->conn_ptr = conn; in PHP_FUNCTION()
3294 result->fetched = 0; in PHP_FUNCTION()
3295 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3305 odbc_result *result = NULL; in PHP_FUNCTION() local
3320 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3322 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3324 efree(result); in PHP_FUNCTION()
3331 efree(result); in PHP_FUNCTION()
3335 rc = SQLColumnPrivileges(result->stmt, in PHP_FUNCTION()
3343 efree(result); in PHP_FUNCTION()
3347 result->numparams = 0; in PHP_FUNCTION()
3348 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3350 if (result->numcols > 0) { in PHP_FUNCTION()
3351 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3352 efree(result); in PHP_FUNCTION()
3356 result->values = NULL; in PHP_FUNCTION()
3358 result->conn_ptr = conn; in PHP_FUNCTION()
3359 result->fetched = 0; in PHP_FUNCTION()
3360 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3371 odbc_result *result = NULL; in PHP_FUNCTION() local
3398 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3400 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3402 efree(result); in PHP_FUNCTION()
3409 efree(result); in PHP_FUNCTION()
3413 rc = SQLForeignKeys(result->stmt, in PHP_FUNCTION()
3423 efree(result); in PHP_FUNCTION()
3427 result->numparams = 0; in PHP_FUNCTION()
3428 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3430 if (result->numcols > 0) { in PHP_FUNCTION()
3431 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3432 efree(result); in PHP_FUNCTION()
3436 result->values = NULL; in PHP_FUNCTION()
3438 result->conn_ptr = conn; in PHP_FUNCTION()
3439 result->fetched = 0; in PHP_FUNCTION()
3440 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3451 odbc_result *result = NULL; in PHP_FUNCTION() local
3466 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3468 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3470 efree(result); in PHP_FUNCTION()
3477 efree(result); in PHP_FUNCTION()
3481 rc = SQLGetTypeInfo(result->stmt, data_type ); 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)) { 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 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3511 odbc_result *result = NULL; in PHP_FUNCTION() local
3525 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3527 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3529 efree(result); in PHP_FUNCTION()
3536 efree(result); in PHP_FUNCTION()
3540 rc = SQLPrimaryKeys(result->stmt, in PHP_FUNCTION()
3547 efree(result); in PHP_FUNCTION()
3551 result->numparams = 0; in PHP_FUNCTION()
3552 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3554 if (result->numcols > 0) { in PHP_FUNCTION()
3555 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3556 efree(result); in PHP_FUNCTION()
3560 result->values = NULL; in PHP_FUNCTION()
3562 result->conn_ptr = conn; in PHP_FUNCTION()
3563 result->fetched = 0; in PHP_FUNCTION()
3564 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3574 odbc_result *result = NULL; in PHP_FUNCTION() local
3593 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3595 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3597 efree(result); in PHP_FUNCTION()
3604 efree(result); in PHP_FUNCTION()
3608 rc = SQLProcedureColumns(result->stmt, in PHP_FUNCTION()
3616 efree(result); in PHP_FUNCTION()
3620 result->numparams = 0; in PHP_FUNCTION()
3621 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3623 if (result->numcols > 0) { in PHP_FUNCTION()
3624 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3625 efree(result); in PHP_FUNCTION()
3629 result->values = NULL; in PHP_FUNCTION()
3631 result->conn_ptr = conn; in PHP_FUNCTION()
3632 result->fetched = 0; in PHP_FUNCTION()
3633 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3644 odbc_result *result = NULL; in PHP_FUNCTION() local
3662 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3664 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3666 efree(result); in PHP_FUNCTION()
3673 efree(result); in PHP_FUNCTION()
3677 rc = SQLProcedures(result->stmt, in PHP_FUNCTION()
3684 efree(result); in PHP_FUNCTION()
3688 result->numparams = 0; in PHP_FUNCTION()
3689 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3691 if (result->numcols > 0) { in PHP_FUNCTION()
3692 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3693 efree(result); in PHP_FUNCTION()
3697 result->values = NULL; in PHP_FUNCTION()
3699 result->conn_ptr = conn; in PHP_FUNCTION()
3700 result->fetched = 0; in PHP_FUNCTION()
3701 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3712 odbc_result *result = NULL; in PHP_FUNCTION() local
3732 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3734 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3736 efree(result); in PHP_FUNCTION()
3743 efree(result); in PHP_FUNCTION()
3747 rc = SQLSpecialColumns(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)) { 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 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3784 odbc_result *result = NULL; in PHP_FUNCTION() local
3803 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3805 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3807 efree(result); in PHP_FUNCTION()
3814 efree(result); in PHP_FUNCTION()
3818 rc = SQLStatistics(result->stmt, in PHP_FUNCTION()
3827 efree(result); in PHP_FUNCTION()
3831 result->numparams = 0; in PHP_FUNCTION()
3832 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3834 if (result->numcols > 0) { in PHP_FUNCTION()
3835 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3836 efree(result); in PHP_FUNCTION()
3840 result->values = NULL; in PHP_FUNCTION()
3842 result->conn_ptr = conn; in PHP_FUNCTION()
3843 result->fetched = 0; in PHP_FUNCTION()
3844 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3854 odbc_result *result = NULL; in PHP_FUNCTION() local
3868 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3870 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3872 efree(result); in PHP_FUNCTION()
3879 efree(result); in PHP_FUNCTION()
3883 rc = SQLTablePrivileges(result->stmt, in PHP_FUNCTION()
3890 efree(result); in PHP_FUNCTION()
3894 result->numparams = 0; in PHP_FUNCTION()
3895 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3897 if (result->numcols > 0) { in PHP_FUNCTION()
3898 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3899 efree(result); in PHP_FUNCTION()
3903 result->values = NULL; in PHP_FUNCTION()
3905 result->conn_ptr = conn; in PHP_FUNCTION()
3906 result->fetched = 0; in PHP_FUNCTION()
3907 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()