Lines Matching refs:result

110 	ZEND_ARG_INFO(0, result)
115 ZEND_ARG_INFO(0, result)
916 odbc_result *result; in php_odbc_fetch_attribs() local
924 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in php_odbc_fetch_attribs()
929 result->longreadlen = flag; in php_odbc_fetch_attribs()
931 result->binmode = flag; in php_odbc_fetch_attribs()
939 int odbc_bindcols(odbc_result *result) in odbc_bindcols() argument
948 result->values = (odbc_result_value *) safe_emalloc(sizeof(odbc_result_value), result->numcols, 0); in odbc_bindcols()
950 result->longreadlen = ODBCG(defaultlrl); in odbc_bindcols()
951 result->binmode = ODBCG(defaultbinmode); in odbc_bindcols()
953 for(i = 0; i < result->numcols; i++) { in odbc_bindcols()
957 rc = PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(i+1), PHP_ODBC_SQL_DESC_NAME, in odbc_bindcols()
958 result->values[i].name, sizeof(result->values[i].name), &colnamelen, 0); in odbc_bindcols()
959 rc = PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_TYPE, in odbc_bindcols()
960 NULL, 0, NULL, &result->values[i].coltype); in odbc_bindcols()
966 switch(result->values[i].coltype) { in odbc_bindcols()
974 result->values[i].value = NULL; in odbc_bindcols()
979 result->values[i].value = (char *)emalloc(27); in odbc_bindcols()
980 SQLBindCol(result->stmt, (SQLUSMALLINT)(i+1), SQL_C_CHAR, result->values[i].value, in odbc_bindcols()
981 27, &result->values[i].vallen); in odbc_bindcols()
994 rc = PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(i+1), colfieldid, in odbc_bindcols()
1008 …if (SQL_SUCCESS == SQLGetDiagRec(SQL_HANDLE_STMT, result->stmt, 1, state, &err, errtxt, 128, NULL)… in odbc_bindcols()
1016 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
1316 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
1321 if (result->numparams > 0 && numArgs == 1) { in PHP_FUNCTION()
1326 if (result->numparams > 0) { in PHP_FUNCTION()
1327 if ((ne = zend_hash_num_elements(Z_ARRVAL_P(pv_param_arr))) < result->numparams) { in PHP_FUNCTION()
1328 …php_error_docref(NULL, E_WARNING,"Not enough parameters (%d should be %d) given", ne, result->nump… in PHP_FUNCTION()
1333 params = (params_t *)safe_emalloc(sizeof(params_t), result->numparams, 0); in PHP_FUNCTION()
1334 for(i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1338 for(i = 1; i <= result->numparams; i++) { in PHP_FUNCTION()
1341 SQLFreeStmt(result->stmt,SQL_RESET_PARAMS); in PHP_FUNCTION()
1342 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1355 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1356 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1368 if (IS_SQL_BINARY(result->param_info[i-1].sqltype)) { in PHP_FUNCTION()
1387 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1388 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1399 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1400 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1414 rc = SQLBindParameter(result->stmt, (SQLUSMALLINT)i, SQL_PARAM_INPUT, in PHP_FUNCTION()
1415 …ctype, result->param_info[i-1].sqltype, result->param_info[i-1].precision, result->param_info[i-1]… in PHP_FUNCTION()
1426 rc = SQLBindParameter(result->stmt, (SQLUSMALLINT)i, SQL_PARAM_INPUT, in PHP_FUNCTION()
1427 …ctype, result->param_info[i-1].sqltype, result->param_info[i-1].precision, result->param_info[i-1]… in PHP_FUNCTION()
1432 odbc_sql_error(result->conn_ptr, result->stmt, "SQLBindParameter"); in PHP_FUNCTION()
1433 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1434 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1446 rc = SQLFreeStmt(result->stmt, SQL_CLOSE); in PHP_FUNCTION()
1449 odbc_sql_error(result->conn_ptr, result->stmt, "SQLFreeStmt"); in PHP_FUNCTION()
1452 rc = SQLExecute(result->stmt); in PHP_FUNCTION()
1454 result->fetched = 0; in PHP_FUNCTION()
1459 rc = SQLParamData(result->stmt, (void*)&fp); in PHP_FUNCTION()
1462 SQLPutData(result->stmt, (void*)&buf, nbytes); in PHP_FUNCTION()
1472 odbc_sql_error(result->conn_ptr, result->stmt, "SQLExecute"); in PHP_FUNCTION()
1475 odbc_sql_error(result->conn_ptr, result->stmt, "SQLExecute"); in PHP_FUNCTION()
1480 if (result->numparams > 0) { in PHP_FUNCTION()
1481 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1482 for(i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1494 if (result->numcols == 0) { in PHP_FUNCTION()
1495 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1497 if (result->numcols > 0) { in PHP_FUNCTION()
1498 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
1499 efree(result); in PHP_FUNCTION()
1503 result->values = NULL; in PHP_FUNCTION()
1517 odbc_result *result; in PHP_FUNCTION() local
1524 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
1528 …rc = SQLGetInfo(result->conn_ptr->hdbc,SQL_MAX_CURSOR_NAME_LEN, (void *)&max_len,sizeof(max_len),&… in PHP_FUNCTION()
1535 rc = SQLGetCursorName(result->stmt,cursorname,(SQLSMALLINT)max_len,&len); in PHP_FUNCTION()
1542 SQLError( result->conn_ptr->henv, result->conn_ptr->hdbc, in PHP_FUNCTION()
1543 result->stmt, state, &error, errormsg, in PHP_FUNCTION()
1546 snprintf(cursorname, max_len+1, "php_curs_" ZEND_ULONG_FMT, (zend_ulong)result->stmt); in PHP_FUNCTION()
1547 if (SQLSetCursorName(result->stmt,cursorname,SQL_NTS) != SQL_SUCCESS) { in PHP_FUNCTION()
1548 odbc_sql_error(result->conn_ptr, result->stmt, "SQLSetCursorName"); in PHP_FUNCTION()
1637 odbc_result *result = NULL; in PHP_FUNCTION() local
1652 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
1654 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
1657 efree(result); in PHP_FUNCTION()
1663 efree(result); in PHP_FUNCTION()
1672 if ((result->fetch_abs = (scrollopts & SQL_FD_FETCH_ABSOLUTE))) { in PHP_FUNCTION()
1676 SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, ODBCG(default_cursortype)); in PHP_FUNCTION()
1679 result->fetch_abs = 0; in PHP_FUNCTION()
1683 rc = SQLExecDirect(result->stmt, query, SQL_NTS); in PHP_FUNCTION()
1688 odbc_sql_error(conn, result->stmt, "SQLExecDirect"); in PHP_FUNCTION()
1689 SQLFreeStmt(result->stmt, SQL_DROP); in PHP_FUNCTION()
1690 efree(result); in PHP_FUNCTION()
1694 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1697 if (result->numcols > 0) { in PHP_FUNCTION()
1698 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
1699 efree(result); in PHP_FUNCTION()
1703 result->values = NULL; in PHP_FUNCTION()
1706 result->conn_ptr = conn; in PHP_FUNCTION()
1707 result->fetched = 0; in PHP_FUNCTION()
1708 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
1720 odbc_result *result; in php_odbc_fetch_hash() local
1744 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in php_odbc_fetch_hash()
1748 if (result->numcols == 0) { in php_odbc_fetch_hash()
1754 if (result->fetch_abs) { in php_odbc_fetch_hash()
1756 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in php_odbc_fetch_hash()
1758 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in php_odbc_fetch_hash()
1762 rc = SQLFetch(result->stmt); in php_odbc_fetch_hash()
1771 if (rownum > 0 && result->fetch_abs) in php_odbc_fetch_hash()
1772 result->fetched = rownum; in php_odbc_fetch_hash()
1775 result->fetched++; in php_odbc_fetch_hash()
1777 for(i = 0; i < result->numcols; i++) { in php_odbc_fetch_hash()
1780 switch(result->values[i].coltype) { in php_odbc_fetch_hash()
1784 if (result->binmode <= 0) { in php_odbc_fetch_hash()
1788 if (result->binmode == 1) { in php_odbc_fetch_hash()
1795 if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { in php_odbc_fetch_hash()
1800 buf = emalloc(result->longreadlen + 1); in php_odbc_fetch_hash()
1803 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1), sql_c_type, buf, result->longreadlen + 1, &re… in php_odbc_fetch_hash()
1806 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in php_odbc_fetch_hash()
1812 ZVAL_STRINGL(&tmp, buf, result->longreadlen); in php_odbc_fetch_hash()
1816 } else if (result->values[i].vallen == SQL_NULL_DATA) { in php_odbc_fetch_hash()
1820 ZVAL_STRINGL(&tmp, buf, result->values[i].vallen); in php_odbc_fetch_hash()
1825 if (result->values[i].vallen == SQL_NULL_DATA) { in php_odbc_fetch_hash()
1829 ZVAL_STRINGL(&tmp, result->values[i].value, result->values[i].vallen); in php_odbc_fetch_hash()
1836 if (!*(result->values[i].name) && Z_TYPE(tmp) == IS_STRING) { in php_odbc_fetch_hash()
1839 …zend_hash_str_update(Z_ARRVAL_P(return_value), result->values[i].name, strlen(result->values[i].na… in php_odbc_fetch_hash()
1875 odbc_result *result; in PHP_FUNCTION() local
1899 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
1903 if (result->numcols == 0) { in PHP_FUNCTION()
1913 if (result->fetch_abs) { in PHP_FUNCTION()
1915 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in PHP_FUNCTION()
1917 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
1921 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
1928 if (rownum > 0 && result->fetch_abs) in PHP_FUNCTION()
1929 result->fetched = rownum; in PHP_FUNCTION()
1932 result->fetched++; in PHP_FUNCTION()
1934 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
1937 switch(result->values[i].coltype) { in PHP_FUNCTION()
1941 if (result->binmode <= 0) { in PHP_FUNCTION()
1945 if (result->binmode == 1) sql_c_type = SQL_C_BINARY; in PHP_FUNCTION()
1951 if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { in PHP_FUNCTION()
1957 buf = emalloc(result->longreadlen + 1); in PHP_FUNCTION()
1959 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1),sql_c_type, buf, result->longreadlen + 1, &res… in PHP_FUNCTION()
1962 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
1967 ZVAL_STRINGL(&tmp, buf, result->longreadlen); in PHP_FUNCTION()
1971 } else if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
1975 ZVAL_STRINGL(&tmp, buf, result->values[i].vallen); in PHP_FUNCTION()
1980 if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
1984 ZVAL_STRINGL(&tmp, result->values[i].value, result->values[i].vallen); in PHP_FUNCTION()
1990 RETURN_LONG(result->numcols); in PHP_FUNCTION()
1999 odbc_result *result; in PHP_FUNCTION() local
2007 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2010 if (result->numcols == 0) { in PHP_FUNCTION()
2014 rc = SQLFetchPrev(result->stmt); in PHP_FUNCTION()
2020 if (result->fetched > 1) { in PHP_FUNCTION()
2021 result->fetched--; in PHP_FUNCTION()
2034 odbc_result *result; in PHP_FUNCTION() local
2049 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2053 if (result->numcols == 0) { in PHP_FUNCTION()
2059 if (result->fetch_abs) { in PHP_FUNCTION()
2061 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in PHP_FUNCTION()
2063 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2067 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2074 result->fetched = rownum; in PHP_FUNCTION()
2076 result->fetched++; in PHP_FUNCTION()
2091 odbc_result *result; in PHP_FUNCTION() local
2115 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2119 if ((result->numcols == 0)) { in PHP_FUNCTION()
2126 if (result->values == NULL) { in PHP_FUNCTION()
2131 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2132 if (!strcasecmp(result->values[i].name, field)) { in PHP_FUNCTION()
2144 if (field_ind >= result->numcols || field_ind < 0) { in PHP_FUNCTION()
2150 if (result->fetched == 0) { in PHP_FUNCTION()
2153 if (result->fetch_abs) in PHP_FUNCTION()
2154 rc = SQLExtendedFetch(result->stmt, SQL_FETCH_NEXT, 1, &crow,RowStatus); in PHP_FUNCTION()
2157 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2163 result->fetched++; in PHP_FUNCTION()
2166 switch(result->values[field_ind].coltype) { in PHP_FUNCTION()
2170 if (result->binmode <= 1) { in PHP_FUNCTION()
2173 if (result->binmode <= 0) { in PHP_FUNCTION()
2180 if (IS_SQL_LONG(result->values[field_ind].coltype)) { in PHP_FUNCTION()
2181 if (result->longreadlen <= 0) { in PHP_FUNCTION()
2184 fieldsize = result->longreadlen; in PHP_FUNCTION()
2187 PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(field_ind + 1), in PHP_FUNCTION()
2193 fieldsize = (result->longreadlen <= 0) ? 4096 : result->longreadlen; in PHP_FUNCTION()
2199 rc = SQLGetData(result->stmt, (SQLUSMALLINT)(field_ind + 1), sql_c_type, in PHP_FUNCTION()
2200 ZSTR_VAL(field_str), fieldsize, &result->values[field_ind].vallen); in PHP_FUNCTION()
2203 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2212 } else if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2218 if ((result->values[field_ind].coltype == SQL_LONGVARCHAR) in PHP_FUNCTION()
2220 || (result->values[field_ind].coltype == SQL_WLONGVARCHAR) in PHP_FUNCTION()
2229 field_str = zend_string_truncate(field_str, result->values[field_ind].vallen, 0); in PHP_FUNCTION()
2236 if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2239 RETURN_STRINGL(result->values[field_ind].value, result->values[field_ind].vallen); in PHP_FUNCTION()
2252 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(field_ind + 1),sql_c_type, field, fieldsize, &result-… in PHP_FUNCTION()
2255 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2266 if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2271 PHPWRITE(field,(rc == SQL_SUCCESS_WITH_INFO) ? 4095 : result->values[field_ind].vallen); in PHP_FUNCTION()
2287 odbc_result *result; in PHP_FUNCTION() local
2302 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2306 if (result->numcols == 0) { in PHP_FUNCTION()
2311 if (result->fetch_abs) in PHP_FUNCTION()
2312 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2315 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2329 for (i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2330 php_printf("<th>%s</th>", result->values[i].name); in PHP_FUNCTION()
2336 result->fetched++; in PHP_FUNCTION()
2338 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2340 switch(result->values[i].coltype) { in PHP_FUNCTION()
2344 if (result->binmode <= 0) { in PHP_FUNCTION()
2348 if (result->binmode <= 1) sql_c_type = SQL_C_BINARY; in PHP_FUNCTION()
2353 if (IS_SQL_LONG(result->values[i].coltype) && in PHP_FUNCTION()
2354 result->longreadlen <= 0) { in PHP_FUNCTION()
2360 buf = emalloc(result->longreadlen); in PHP_FUNCTION()
2363 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1),sql_c_type, buf, result->longreadlen, &result-… in PHP_FUNCTION()
2368 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2374 PHPWRITE(buf, result->longreadlen); in PHP_FUNCTION()
2380 } else if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2384 PHPWRITE(buf, result->values[i].vallen); in PHP_FUNCTION()
2389 if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2392 php_printf("<td>%s</td>", result->values[i].value); in PHP_FUNCTION()
2400 if (result->fetch_abs) in PHP_FUNCTION()
2401 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2404 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2408 RETURN_LONG(result->fetched); in PHP_FUNCTION()
2417 odbc_result *result; in PHP_FUNCTION() local
2424 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2428 if (result->values) { in PHP_FUNCTION()
2429 for (i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2430 if (result->values[i].value) { in PHP_FUNCTION()
2431 efree(result->values[i].value); in PHP_FUNCTION()
2434 efree(result->values); in PHP_FUNCTION()
2435 result->values = NULL; in PHP_FUNCTION()
2752 odbc_result *result; in PHP_FUNCTION() local
2760 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2764 SQLRowCount(result->stmt, &rows); in PHP_FUNCTION()
2774 odbc_result *result; in PHP_FUNCTION() local
2782 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2786 if (result->values) { in PHP_FUNCTION()
2787 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2788 if (result->values[i].value) { in PHP_FUNCTION()
2789 efree(result->values[i].value); in PHP_FUNCTION()
2792 efree(result->values); in PHP_FUNCTION()
2793 result->values = NULL; in PHP_FUNCTION()
2794 result->numcols = 0; in PHP_FUNCTION()
2797 result->fetched = 0; in PHP_FUNCTION()
2798 rc = SQLMoreResults(result->stmt); in PHP_FUNCTION()
2800 rc = SQLFreeStmt(result->stmt, SQL_UNBIND); in PHP_FUNCTION()
2801 SQLNumParams(result->stmt, &(result->numparams)); in PHP_FUNCTION()
2802 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
2804 if (result->numcols > 0) { in PHP_FUNCTION()
2805 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
2806 efree(result); in PHP_FUNCTION()
2810 result->values = NULL; in PHP_FUNCTION()
2816 odbc_sql_error(result->conn_ptr, result->stmt, "SQLMoreResults"); in PHP_FUNCTION()
2827 odbc_result *result; in PHP_FUNCTION() local
2834 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2838 RETURN_LONG(result->numcols); in PHP_FUNCTION()
2846 odbc_result *result; in PHP_FUNCTION() local
2854 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2858 if (result->numcols == 0) { in PHP_FUNCTION()
2863 if (pv_num > result->numcols) { in PHP_FUNCTION()
2873 RETURN_STRING(result->values[pv_num - 1].name); in PHP_FUNCTION()
2881 odbc_result *result; in PHP_FUNCTION() local
2891 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2895 if (result->numcols == 0) { in PHP_FUNCTION()
2900 if (pv_num > result->numcols) { in PHP_FUNCTION()
2910 …PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)pv_num, SQL_COLUMN_TYPE_NAME, tmp, 31, &tmple… in PHP_FUNCTION()
2937 odbc_result *result; in PHP_FUNCTION() local
2944 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2948 if (result->numcols == 0) { in PHP_FUNCTION()
2954 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2955 if (strcasecmp(result->values[i].name, fname) == 0) { in PHP_FUNCTION()
3080 odbc_result *result; in PHP_FUNCTION() local
3106 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_handle), "ODBC result", le_result)) ==… in PHP_FUNCTION()
3110 rc = SQLSetStmtOption(result->stmt, (unsigned short) pv_opt, pv_val); in PHP_FUNCTION()
3113 odbc_sql_error(result->conn_ptr, result->stmt, "SetStmtOption"); in PHP_FUNCTION()
3136 odbc_result *result = NULL; in PHP_FUNCTION() local
3151 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3153 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3155 efree(result); in PHP_FUNCTION()
3162 efree(result); in PHP_FUNCTION()
3171 rc = SQLTables(result->stmt, in PHP_FUNCTION()
3178 odbc_sql_error(conn, result->stmt, "SQLTables"); in PHP_FUNCTION()
3179 efree(result); in PHP_FUNCTION()
3183 result->numparams = 0; in PHP_FUNCTION()
3184 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3186 if (result->numcols > 0) { in PHP_FUNCTION()
3187 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3188 efree(result); in PHP_FUNCTION()
3192 result->values = NULL; in PHP_FUNCTION()
3194 result->conn_ptr = conn; in PHP_FUNCTION()
3195 result->fetched = 0; in PHP_FUNCTION()
3196 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3205 odbc_result *result = NULL; in PHP_FUNCTION() local
3220 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3222 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3224 efree(result); in PHP_FUNCTION()
3231 efree(result); in PHP_FUNCTION()
3242 rc = SQLColumns(result->stmt, in PHP_FUNCTION()
3249 odbc_sql_error(conn, result->stmt, "SQLColumns"); in PHP_FUNCTION()
3250 efree(result); in PHP_FUNCTION()
3254 result->numparams = 0; in PHP_FUNCTION()
3255 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3257 if (result->numcols > 0) { in PHP_FUNCTION()
3258 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3259 efree(result); in PHP_FUNCTION()
3263 result->values = NULL; in PHP_FUNCTION()
3265 result->conn_ptr = conn; in PHP_FUNCTION()
3266 result->fetched = 0; in PHP_FUNCTION()
3267 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3277 odbc_result *result = NULL; in PHP_FUNCTION() local
3292 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3294 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3296 efree(result); in PHP_FUNCTION()
3303 efree(result); in PHP_FUNCTION()
3307 rc = SQLColumnPrivileges(result->stmt, in PHP_FUNCTION()
3314 odbc_sql_error(conn, result->stmt, "SQLColumnPrivileges"); in PHP_FUNCTION()
3315 efree(result); in PHP_FUNCTION()
3319 result->numparams = 0; in PHP_FUNCTION()
3320 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3322 if (result->numcols > 0) { in PHP_FUNCTION()
3323 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3324 efree(result); in PHP_FUNCTION()
3328 result->values = NULL; in PHP_FUNCTION()
3330 result->conn_ptr = conn; in PHP_FUNCTION()
3331 result->fetched = 0; in PHP_FUNCTION()
3332 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3343 odbc_result *result = NULL; in PHP_FUNCTION() local
3370 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3372 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3374 efree(result); in PHP_FUNCTION()
3381 efree(result); in PHP_FUNCTION()
3385 rc = SQLForeignKeys(result->stmt, in PHP_FUNCTION()
3394 odbc_sql_error(conn, result->stmt, "SQLForeignKeys"); in PHP_FUNCTION()
3395 efree(result); in PHP_FUNCTION()
3399 result->numparams = 0; in PHP_FUNCTION()
3400 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3402 if (result->numcols > 0) { in PHP_FUNCTION()
3403 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3404 efree(result); in PHP_FUNCTION()
3408 result->values = NULL; in PHP_FUNCTION()
3410 result->conn_ptr = conn; in PHP_FUNCTION()
3411 result->fetched = 0; in PHP_FUNCTION()
3412 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3423 odbc_result *result = NULL; in PHP_FUNCTION() local
3438 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3440 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3442 efree(result); in PHP_FUNCTION()
3449 efree(result); in PHP_FUNCTION()
3453 rc = SQLGetTypeInfo(result->stmt, data_type ); in PHP_FUNCTION()
3456 odbc_sql_error(conn, result->stmt, "SQLGetTypeInfo"); in PHP_FUNCTION()
3457 efree(result); in PHP_FUNCTION()
3461 result->numparams = 0; in PHP_FUNCTION()
3462 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3464 if (result->numcols > 0) { in PHP_FUNCTION()
3465 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3466 efree(result); in PHP_FUNCTION()
3470 result->values = NULL; in PHP_FUNCTION()
3472 result->conn_ptr = conn; in PHP_FUNCTION()
3473 result->fetched = 0; in PHP_FUNCTION()
3474 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3483 odbc_result *result = NULL; in PHP_FUNCTION() local
3497 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3499 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3501 efree(result); in PHP_FUNCTION()
3508 efree(result); in PHP_FUNCTION()
3512 rc = SQLPrimaryKeys(result->stmt, in PHP_FUNCTION()
3518 odbc_sql_error(conn, result->stmt, "SQLPrimaryKeys"); in PHP_FUNCTION()
3519 efree(result); in PHP_FUNCTION()
3523 result->numparams = 0; in PHP_FUNCTION()
3524 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3526 if (result->numcols > 0) { in PHP_FUNCTION()
3527 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3528 efree(result); in PHP_FUNCTION()
3532 result->values = NULL; in PHP_FUNCTION()
3534 result->conn_ptr = conn; in PHP_FUNCTION()
3535 result->fetched = 0; in PHP_FUNCTION()
3536 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3546 odbc_result *result = NULL; in PHP_FUNCTION() local
3565 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3567 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3569 efree(result); in PHP_FUNCTION()
3576 efree(result); in PHP_FUNCTION()
3580 rc = SQLProcedureColumns(result->stmt, in PHP_FUNCTION()
3587 odbc_sql_error(conn, result->stmt, "SQLProcedureColumns"); in PHP_FUNCTION()
3588 efree(result); in PHP_FUNCTION()
3592 result->numparams = 0; in PHP_FUNCTION()
3593 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3595 if (result->numcols > 0) { in PHP_FUNCTION()
3596 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3597 efree(result); in PHP_FUNCTION()
3601 result->values = NULL; in PHP_FUNCTION()
3603 result->conn_ptr = conn; in PHP_FUNCTION()
3604 result->fetched = 0; in PHP_FUNCTION()
3605 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3616 odbc_result *result = NULL; in PHP_FUNCTION() local
3634 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3636 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3638 efree(result); in PHP_FUNCTION()
3645 efree(result); in PHP_FUNCTION()
3649 rc = SQLProcedures(result->stmt, in PHP_FUNCTION()
3655 odbc_sql_error(conn, result->stmt, "SQLProcedures"); in PHP_FUNCTION()
3656 efree(result); in PHP_FUNCTION()
3660 result->numparams = 0; in PHP_FUNCTION()
3661 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3663 if (result->numcols > 0) { in PHP_FUNCTION()
3664 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3665 efree(result); in PHP_FUNCTION()
3669 result->values = NULL; in PHP_FUNCTION()
3671 result->conn_ptr = conn; in PHP_FUNCTION()
3672 result->fetched = 0; in PHP_FUNCTION()
3673 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3684 odbc_result *result = NULL; in PHP_FUNCTION() local
3704 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3706 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3708 efree(result); in PHP_FUNCTION()
3715 efree(result); in PHP_FUNCTION()
3719 rc = SQLSpecialColumns(result->stmt, in PHP_FUNCTION()
3728 odbc_sql_error(conn, result->stmt, "SQLSpecialColumns"); in PHP_FUNCTION()
3729 efree(result); in PHP_FUNCTION()
3733 result->numparams = 0; in PHP_FUNCTION()
3734 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3736 if (result->numcols > 0) { in PHP_FUNCTION()
3737 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3738 efree(result); in PHP_FUNCTION()
3742 result->values = NULL; in PHP_FUNCTION()
3744 result->conn_ptr = conn; in PHP_FUNCTION()
3745 result->fetched = 0; in PHP_FUNCTION()
3746 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3756 odbc_result *result = NULL; in PHP_FUNCTION() local
3775 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3777 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3779 efree(result); in PHP_FUNCTION()
3786 efree(result); in PHP_FUNCTION()
3790 rc = SQLStatistics(result->stmt, in PHP_FUNCTION()
3798 odbc_sql_error(conn, result->stmt, "SQLStatistics"); in PHP_FUNCTION()
3799 efree(result); in PHP_FUNCTION()
3803 result->numparams = 0; in PHP_FUNCTION()
3804 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3806 if (result->numcols > 0) { in PHP_FUNCTION()
3807 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3808 efree(result); in PHP_FUNCTION()
3812 result->values = NULL; in PHP_FUNCTION()
3814 result->conn_ptr = conn; in PHP_FUNCTION()
3815 result->fetched = 0; in PHP_FUNCTION()
3816 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3826 odbc_result *result = NULL; in PHP_FUNCTION() local
3840 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3842 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3844 efree(result); in PHP_FUNCTION()
3851 efree(result); in PHP_FUNCTION()
3855 rc = SQLTablePrivileges(result->stmt, in PHP_FUNCTION()
3861 odbc_sql_error(conn, result->stmt, "SQLTablePrivileges"); in PHP_FUNCTION()
3862 efree(result); in PHP_FUNCTION()
3866 result->numparams = 0; in PHP_FUNCTION()
3867 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3869 if (result->numcols > 0) { in PHP_FUNCTION()
3870 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3871 efree(result); in PHP_FUNCTION()
3875 result->values = NULL; in PHP_FUNCTION()
3877 result->conn_ptr = conn; in PHP_FUNCTION()
3878 result->fetched = 0; in PHP_FUNCTION()
3879 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()