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()
1274result->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()
2784 odbc_result *result; in PHP_FUNCTION() local
2792 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2796 SQLRowCount(result->stmt, &rows); in PHP_FUNCTION()
2806 odbc_result *result; in PHP_FUNCTION() local
2814 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2818 if (result->values) { in PHP_FUNCTION()
2819 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2820 if (result->values[i].value) { in PHP_FUNCTION()
2821 efree(result->values[i].value); in PHP_FUNCTION()
2824 efree(result->values); in PHP_FUNCTION()
2825 result->values = NULL; in PHP_FUNCTION()
2828 result->fetched = 0; in PHP_FUNCTION()
2829 rc = SQLMoreResults(result->stmt); in PHP_FUNCTION()
2831 rc = SQLFreeStmt(result->stmt, SQL_UNBIND); in PHP_FUNCTION()
2832 SQLNumParams(result->stmt, &(result->numparams)); in PHP_FUNCTION()
2833 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
2835 if (result->numcols > 0) { in PHP_FUNCTION()
2836 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
2837 efree(result); in PHP_FUNCTION()
2841 result->values = NULL; in PHP_FUNCTION()
2847 odbc_sql_error(result->conn_ptr, result->stmt, "SQLMoreResults"); in PHP_FUNCTION()
2858 odbc_result *result; in PHP_FUNCTION() local
2865 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2869 RETURN_LONG(result->numcols); in PHP_FUNCTION()
2877 odbc_result *result; in PHP_FUNCTION() local
2885 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2889 if (result->numcols == 0) { in PHP_FUNCTION()
2894 if (pv_num > result->numcols) { in PHP_FUNCTION()
2904 RETURN_STRING(result->values[pv_num - 1].name); in PHP_FUNCTION()
2912 odbc_result *result; in PHP_FUNCTION() local
2922 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2926 if (result->numcols == 0) { in PHP_FUNCTION()
2931 if (pv_num > result->numcols) { in PHP_FUNCTION()
2941 …PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)pv_num, SQL_COLUMN_TYPE_NAME, tmp, 31, &tmple… in PHP_FUNCTION()
2968 odbc_result *result; in PHP_FUNCTION() local
2975 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2979 if (result->numcols == 0) { in PHP_FUNCTION()
2985 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2986 if (strcasecmp(result->values[i].name, fname) == 0) { in PHP_FUNCTION()
3111 odbc_result *result; in PHP_FUNCTION() local
3137 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_handle), "ODBC result", le_result)) ==… in PHP_FUNCTION()
3141 rc = SQLSetStmtOption(result->stmt, (unsigned short) pv_opt, pv_val); in PHP_FUNCTION()
3144 odbc_sql_error(result->conn_ptr, result->stmt, "SetStmtOption"); in PHP_FUNCTION()
3167 odbc_result *result = NULL; in PHP_FUNCTION() local
3182 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3184 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3186 efree(result); in PHP_FUNCTION()
3193 efree(result); in PHP_FUNCTION()
3202 rc = SQLTables(result->stmt, in PHP_FUNCTION()
3210 efree(result); in PHP_FUNCTION()
3214 result->numparams = 0; in PHP_FUNCTION()
3215 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3217 if (result->numcols > 0) { in PHP_FUNCTION()
3218 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3219 efree(result); in PHP_FUNCTION()
3223 result->values = NULL; in PHP_FUNCTION()
3225 result->conn_ptr = conn; in PHP_FUNCTION()
3226 result->fetched = 0; in PHP_FUNCTION()
3227 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3236 odbc_result *result = NULL; in PHP_FUNCTION() local
3251 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3253 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3255 efree(result); in PHP_FUNCTION()
3262 efree(result); in PHP_FUNCTION()
3273 rc = SQLColumns(result->stmt, in PHP_FUNCTION()
3281 efree(result); in PHP_FUNCTION()
3285 result->numparams = 0; in PHP_FUNCTION()
3286 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3288 if (result->numcols > 0) { in PHP_FUNCTION()
3289 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3290 efree(result); in PHP_FUNCTION()
3294 result->values = NULL; in PHP_FUNCTION()
3296 result->conn_ptr = conn; in PHP_FUNCTION()
3297 result->fetched = 0; in PHP_FUNCTION()
3298 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3308 odbc_result *result = NULL; in PHP_FUNCTION() local
3323 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3325 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3327 efree(result); in PHP_FUNCTION()
3334 efree(result); in PHP_FUNCTION()
3338 rc = SQLColumnPrivileges(result->stmt, in PHP_FUNCTION()
3346 efree(result); in PHP_FUNCTION()
3350 result->numparams = 0; in PHP_FUNCTION()
3351 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3353 if (result->numcols > 0) { in PHP_FUNCTION()
3354 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3355 efree(result); in PHP_FUNCTION()
3359 result->values = NULL; in PHP_FUNCTION()
3361 result->conn_ptr = conn; in PHP_FUNCTION()
3362 result->fetched = 0; in PHP_FUNCTION()
3363 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3374 odbc_result *result = NULL; in PHP_FUNCTION() local
3401 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3403 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3405 efree(result); in PHP_FUNCTION()
3412 efree(result); in PHP_FUNCTION()
3416 rc = SQLForeignKeys(result->stmt, in PHP_FUNCTION()
3426 efree(result); in PHP_FUNCTION()
3430 result->numparams = 0; in PHP_FUNCTION()
3431 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3433 if (result->numcols > 0) { in PHP_FUNCTION()
3434 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3435 efree(result); in PHP_FUNCTION()
3439 result->values = NULL; in PHP_FUNCTION()
3441 result->conn_ptr = conn; in PHP_FUNCTION()
3442 result->fetched = 0; in PHP_FUNCTION()
3443 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3454 odbc_result *result = NULL; in PHP_FUNCTION() local
3469 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3471 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3473 efree(result); in PHP_FUNCTION()
3480 efree(result); in PHP_FUNCTION()
3484 rc = SQLGetTypeInfo(result->stmt, data_type ); in PHP_FUNCTION()
3488 efree(result); in PHP_FUNCTION()
3492 result->numparams = 0; in PHP_FUNCTION()
3493 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3495 if (result->numcols > 0) { in PHP_FUNCTION()
3496 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3497 efree(result); in PHP_FUNCTION()
3501 result->values = NULL; in PHP_FUNCTION()
3503 result->conn_ptr = conn; in PHP_FUNCTION()
3504 result->fetched = 0; in PHP_FUNCTION()
3505 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3514 odbc_result *result = NULL; in PHP_FUNCTION() local
3528 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3530 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3532 efree(result); in PHP_FUNCTION()
3539 efree(result); in PHP_FUNCTION()
3543 rc = SQLPrimaryKeys(result->stmt, in PHP_FUNCTION()
3550 efree(result); in PHP_FUNCTION()
3554 result->numparams = 0; in PHP_FUNCTION()
3555 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3557 if (result->numcols > 0) { in PHP_FUNCTION()
3558 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3559 efree(result); in PHP_FUNCTION()
3563 result->values = NULL; in PHP_FUNCTION()
3565 result->conn_ptr = conn; in PHP_FUNCTION()
3566 result->fetched = 0; in PHP_FUNCTION()
3567 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3577 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 = SQLProcedureColumns(result->stmt, in PHP_FUNCTION()
3619 efree(result); in PHP_FUNCTION()
3623 result->numparams = 0; in PHP_FUNCTION()
3624 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3626 if (result->numcols > 0) { in PHP_FUNCTION()
3627 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3628 efree(result); in PHP_FUNCTION()
3632 result->values = NULL; in PHP_FUNCTION()
3634 result->conn_ptr = conn; in PHP_FUNCTION()
3635 result->fetched = 0; in PHP_FUNCTION()
3636 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3647 odbc_result *result = NULL; in PHP_FUNCTION() local
3665 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3667 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3669 efree(result); in PHP_FUNCTION()
3676 efree(result); in PHP_FUNCTION()
3680 rc = SQLProcedures(result->stmt, in PHP_FUNCTION()
3687 efree(result); in PHP_FUNCTION()
3691 result->numparams = 0; in PHP_FUNCTION()
3692 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3694 if (result->numcols > 0) { in PHP_FUNCTION()
3695 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3696 efree(result); in PHP_FUNCTION()
3700 result->values = NULL; in PHP_FUNCTION()
3702 result->conn_ptr = conn; in PHP_FUNCTION()
3703 result->fetched = 0; in PHP_FUNCTION()
3704 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3715 odbc_result *result = NULL; in PHP_FUNCTION() local
3735 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3737 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3739 efree(result); in PHP_FUNCTION()
3746 efree(result); in PHP_FUNCTION()
3750 rc = SQLSpecialColumns(result->stmt, in PHP_FUNCTION()
3760 efree(result); in PHP_FUNCTION()
3764 result->numparams = 0; in PHP_FUNCTION()
3765 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3767 if (result->numcols > 0) { in PHP_FUNCTION()
3768 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3769 efree(result); in PHP_FUNCTION()
3773 result->values = NULL; in PHP_FUNCTION()
3775 result->conn_ptr = conn; in PHP_FUNCTION()
3776 result->fetched = 0; in PHP_FUNCTION()
3777 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3787 odbc_result *result = NULL; in PHP_FUNCTION() local
3806 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3808 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3810 efree(result); in PHP_FUNCTION()
3817 efree(result); in PHP_FUNCTION()
3821 rc = SQLStatistics(result->stmt, in PHP_FUNCTION()
3830 efree(result); in PHP_FUNCTION()
3834 result->numparams = 0; in PHP_FUNCTION()
3835 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3837 if (result->numcols > 0) { in PHP_FUNCTION()
3838 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3839 efree(result); in PHP_FUNCTION()
3843 result->values = NULL; in PHP_FUNCTION()
3845 result->conn_ptr = conn; in PHP_FUNCTION()
3846 result->fetched = 0; in PHP_FUNCTION()
3847 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3857 odbc_result *result = NULL; in PHP_FUNCTION() local
3871 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3873 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3875 efree(result); in PHP_FUNCTION()
3882 efree(result); in PHP_FUNCTION()
3886 rc = SQLTablePrivileges(result->stmt, in PHP_FUNCTION()
3893 efree(result); in PHP_FUNCTION()
3897 result->numparams = 0; in PHP_FUNCTION()
3898 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3900 if (result->numcols > 0) { in PHP_FUNCTION()
3901 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3902 efree(result); in PHP_FUNCTION()
3906 result->values = NULL; in PHP_FUNCTION()
3908 result->conn_ptr = conn; in PHP_FUNCTION()
3909 result->fetched = 0; in PHP_FUNCTION()
3910 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()