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 (result->values[i].coltype == SQL_TIMESTAMP) { in odbc_bindcols()
1039 result->values[i].value = (char *)emalloc(displaysize + 1); in odbc_bindcols()
1040 rc = SQLBindCol(result->stmt, (SQLUSMALLINT)(i+1), SQL_C_CHAR, result->values[i].value, in odbc_bindcols()
1041 displaysize + 1, &result->values[i].vallen); in odbc_bindcols()
1088 odbc_result *result; in odbc_column_lengths() local
1107 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in odbc_column_lengths()
1111 if (result->numcols == 0) { in odbc_column_lengths()
1116 if (pv_num > result->numcols) { in odbc_column_lengths()
1126 …PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)pv_num, (SQLUSMALLINT) (type?SQL_COLUMN_SCALE… in odbc_column_lengths()
1190 odbc_result *result = NULL; in PHP_FUNCTION() local
1206 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
1208 result->numparams = 0; in PHP_FUNCTION()
1209 result->param_info = NULL; in PHP_FUNCTION()
1211 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
1213 efree(result); in PHP_FUNCTION()
1220 efree(result); in PHP_FUNCTION()
1229 if ((result->fetch_abs = (scrollopts & SQL_FD_FETCH_ABSOLUTE))) { in PHP_FUNCTION()
1233 SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, ODBCG(default_cursortype)); in PHP_FUNCTION()
1236 result->fetch_abs = 0; in PHP_FUNCTION()
1240 rc = SQLPrepare(result->stmt, query, SQL_NTS); in PHP_FUNCTION()
1245 odbc_sql_error(conn, result->stmt, "SQLPrepare"); in PHP_FUNCTION()
1248 odbc_sql_error(conn, result->stmt, "SQLPrepare"); in PHP_FUNCTION()
1252 SQLNumParams(result->stmt, &(result->numparams)); in PHP_FUNCTION()
1253 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1255 if (result->numcols > 0) { in PHP_FUNCTION()
1256 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
1257 efree(result); in PHP_FUNCTION()
1261 result->values = NULL; in PHP_FUNCTION()
1264 result->conn_ptr = conn; in PHP_FUNCTION()
1265 result->fetched = 0; in PHP_FUNCTION()
1267result->param_info = (odbc_param_info *) safe_emalloc(sizeof(odbc_param_info), result->numparams, … in PHP_FUNCTION()
1268 for (i=0;i<result->numparams;i++) { in PHP_FUNCTION()
1269 …rc = SQLDescribeParam(result->stmt, (SQLUSMALLINT)(i+1), &result->param_info[i].sqltype, &result->… in PHP_FUNCTION()
1270 &result->param_info[i].scale, &result->param_info[i].nullable); in PHP_FUNCTION()
1272 odbc_sql_error(result->conn_ptr, result->stmt, "SQLDescribeParameter"); in PHP_FUNCTION()
1273 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1274 efree(result->param_info); in PHP_FUNCTION()
1275 efree(result); in PHP_FUNCTION()
1280 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
1301 odbc_result *result; in PHP_FUNCTION() local
1311 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
1316 if (result->numparams > 0 && numArgs == 1) { in PHP_FUNCTION()
1321 if (result->numparams > 0) { in PHP_FUNCTION()
1322 if ((ne = zend_hash_num_elements(Z_ARRVAL_P(pv_param_arr))) < result->numparams) { in PHP_FUNCTION()
1323 …php_error_docref(NULL, E_WARNING,"Not enough parameters (%d should be %d) given", ne, result->nump… in PHP_FUNCTION()
1328 params = (params_t *)safe_emalloc(sizeof(params_t), result->numparams, 0); in PHP_FUNCTION()
1329 for(i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1333 for(i = 1; i <= result->numparams; i++) { in PHP_FUNCTION()
1336 SQLFreeStmt(result->stmt,SQL_RESET_PARAMS); in PHP_FUNCTION()
1337 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1350 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1351 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1363 if (IS_SQL_BINARY(result->param_info[i-1].sqltype)) { in PHP_FUNCTION()
1382 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1383 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1394 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1395 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1409 rc = SQLBindParameter(result->stmt, (SQLUSMALLINT)i, SQL_PARAM_INPUT, in PHP_FUNCTION()
1410 …ctype, result->param_info[i-1].sqltype, result->param_info[i-1].precision, result->param_info[i-1]… in PHP_FUNCTION()
1421 rc = SQLBindParameter(result->stmt, (SQLUSMALLINT)i, SQL_PARAM_INPUT, in PHP_FUNCTION()
1422 …ctype, result->param_info[i-1].sqltype, result->param_info[i-1].precision, result->param_info[i-1]… in PHP_FUNCTION()
1427 odbc_sql_error(result->conn_ptr, result->stmt, "SQLBindParameter"); in PHP_FUNCTION()
1428 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1429 for (i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1441 rc = SQLFreeStmt(result->stmt, SQL_CLOSE); in PHP_FUNCTION()
1444 odbc_sql_error(result->conn_ptr, result->stmt, "SQLFreeStmt"); in PHP_FUNCTION()
1447 rc = SQLExecute(result->stmt); in PHP_FUNCTION()
1449 result->fetched = 0; in PHP_FUNCTION()
1454 rc = SQLParamData(result->stmt, (void*)&fp); in PHP_FUNCTION()
1457 SQLPutData(result->stmt, (void*)&buf, nbytes); in PHP_FUNCTION()
1467 odbc_sql_error(result->conn_ptr, result->stmt, "SQLExecute"); in PHP_FUNCTION()
1470 odbc_sql_error(result->conn_ptr, result->stmt, "SQLExecute"); in PHP_FUNCTION()
1475 if (result->numparams > 0) { in PHP_FUNCTION()
1476 SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); in PHP_FUNCTION()
1477 for(i = 0; i < result->numparams; i++) { in PHP_FUNCTION()
1489 if (result->numcols == 0) { in PHP_FUNCTION()
1490 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1492 if (result->numcols > 0) { in PHP_FUNCTION()
1493 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
1494 efree(result); in PHP_FUNCTION()
1498 result->values = NULL; in PHP_FUNCTION()
1512 odbc_result *result; in PHP_FUNCTION() local
1519 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
1523 …rc = SQLGetInfo(result->conn_ptr->hdbc,SQL_MAX_CURSOR_NAME_LEN, (void *)&max_len,sizeof(max_len),&… in PHP_FUNCTION()
1530 rc = SQLGetCursorName(result->stmt,cursorname,(SQLSMALLINT)max_len,&len); in PHP_FUNCTION()
1537 SQLError( result->conn_ptr->henv, result->conn_ptr->hdbc, in PHP_FUNCTION()
1538 result->stmt, state, &error, errormsg, in PHP_FUNCTION()
1541 snprintf(cursorname, max_len+1, "php_curs_" ZEND_ULONG_FMT, (zend_ulong)result->stmt); in PHP_FUNCTION()
1542 if (SQLSetCursorName(result->stmt,cursorname,SQL_NTS) != SQL_SUCCESS) { in PHP_FUNCTION()
1543 odbc_sql_error(result->conn_ptr, result->stmt, "SQLSetCursorName"); in PHP_FUNCTION()
1629 odbc_result *result = NULL; in PHP_FUNCTION() local
1646 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
1648 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
1651 efree(result); in PHP_FUNCTION()
1657 efree(result); in PHP_FUNCTION()
1666 if ((result->fetch_abs = (scrollopts & SQL_FD_FETCH_ABSOLUTE))) { in PHP_FUNCTION()
1670 SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, ODBCG(default_cursortype)); in PHP_FUNCTION()
1673 result->fetch_abs = 0; in PHP_FUNCTION()
1677 rc = SQLExecDirect(result->stmt, query, SQL_NTS); in PHP_FUNCTION()
1682 odbc_sql_error(conn, result->stmt, "SQLExecDirect"); in PHP_FUNCTION()
1683 SQLFreeStmt(result->stmt, SQL_DROP); in PHP_FUNCTION()
1684 efree(result); in PHP_FUNCTION()
1688 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
1691 if (result->numcols > 0) { in PHP_FUNCTION()
1692 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
1693 efree(result); in PHP_FUNCTION()
1697 result->values = NULL; in PHP_FUNCTION()
1700 result->conn_ptr = conn; in PHP_FUNCTION()
1701 result->fetched = 0; in PHP_FUNCTION()
1702 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
1714 odbc_result *result; in php_odbc_fetch_hash() local
1738 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in php_odbc_fetch_hash()
1742 if (result->numcols == 0) { in php_odbc_fetch_hash()
1748 if (result->fetch_abs) { in php_odbc_fetch_hash()
1750 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in php_odbc_fetch_hash()
1752 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in php_odbc_fetch_hash()
1756 rc = SQLFetch(result->stmt); in php_odbc_fetch_hash()
1765 if (rownum > 0 && result->fetch_abs) in php_odbc_fetch_hash()
1766 result->fetched = rownum; in php_odbc_fetch_hash()
1769 result->fetched++; in php_odbc_fetch_hash()
1771 for(i = 0; i < result->numcols; i++) { in php_odbc_fetch_hash()
1774 switch(result->values[i].coltype) { in php_odbc_fetch_hash()
1778 if (result->binmode <= 0) { in php_odbc_fetch_hash()
1782 if (result->binmode == 1) { in php_odbc_fetch_hash()
1789 if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { in php_odbc_fetch_hash()
1794 buf = emalloc(result->longreadlen + 1); in php_odbc_fetch_hash()
1797 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1), sql_c_type, buf, result->longreadlen + 1, &re… in php_odbc_fetch_hash()
1800 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in php_odbc_fetch_hash()
1806 ZVAL_STRINGL(&tmp, buf, result->longreadlen); in php_odbc_fetch_hash()
1807 } else if (result->values[i].vallen == SQL_NULL_DATA) { in php_odbc_fetch_hash()
1811 ZVAL_STRINGL(&tmp, buf, result->values[i].vallen); in php_odbc_fetch_hash()
1816 if (result->values[i].vallen == SQL_NULL_DATA) { in php_odbc_fetch_hash()
1820 ZVAL_STRINGL(&tmp, result->values[i].value, result->values[i].vallen); in php_odbc_fetch_hash()
1827 if (!*(result->values[i].name) && Z_TYPE(tmp) == IS_STRING) { in php_odbc_fetch_hash()
1830 …zend_hash_str_update(Z_ARRVAL_P(return_value), result->values[i].name, strlen(result->values[i].na… in php_odbc_fetch_hash()
1866 odbc_result *result; in PHP_FUNCTION() local
1890 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
1894 if (result->numcols == 0) { in PHP_FUNCTION()
1904 if (result->fetch_abs) { in PHP_FUNCTION()
1906 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in PHP_FUNCTION()
1908 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
1912 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
1919 if (rownum > 0 && result->fetch_abs) in PHP_FUNCTION()
1920 result->fetched = rownum; in PHP_FUNCTION()
1923 result->fetched++; in PHP_FUNCTION()
1925 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
1928 switch(result->values[i].coltype) { in PHP_FUNCTION()
1932 if (result->binmode <= 0) { in PHP_FUNCTION()
1936 if (result->binmode == 1) sql_c_type = SQL_C_BINARY; in PHP_FUNCTION()
1942 if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { in PHP_FUNCTION()
1948 buf = emalloc(result->longreadlen + 1); in PHP_FUNCTION()
1950 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1),sql_c_type, buf, result->longreadlen + 1, &res… in PHP_FUNCTION()
1953 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
1958 ZVAL_STRINGL(&tmp, buf, result->longreadlen); in PHP_FUNCTION()
1959 } else if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
1963 ZVAL_STRINGL(&tmp, buf, result->values[i].vallen); in PHP_FUNCTION()
1968 if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
1972 ZVAL_STRINGL(&tmp, result->values[i].value, result->values[i].vallen); in PHP_FUNCTION()
1978 RETURN_LONG(result->numcols); in PHP_FUNCTION()
1987 odbc_result *result; in PHP_FUNCTION() local
1995 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
1998 if (result->numcols == 0) { in PHP_FUNCTION()
2002 rc = SQLFetchPrev(result->stmt); in PHP_FUNCTION()
2008 if (result->fetched > 1) { in PHP_FUNCTION()
2009 result->fetched--; in PHP_FUNCTION()
2022 odbc_result *result; in PHP_FUNCTION() local
2037 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2041 if (result->numcols == 0) { in PHP_FUNCTION()
2047 if (result->fetch_abs) { in PHP_FUNCTION()
2049 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); in PHP_FUNCTION()
2051 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2055 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2062 result->fetched = rownum; in PHP_FUNCTION()
2064 result->fetched++; in PHP_FUNCTION()
2079 odbc_result *result; in PHP_FUNCTION() local
2103 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2107 if ((result->numcols == 0)) { in PHP_FUNCTION()
2114 if (result->values == NULL) { in PHP_FUNCTION()
2119 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2120 if (!strcasecmp(result->values[i].name, field)) { in PHP_FUNCTION()
2132 if (field_ind >= result->numcols || field_ind < 0) { in PHP_FUNCTION()
2138 if (result->fetched == 0) { in PHP_FUNCTION()
2141 if (result->fetch_abs) in PHP_FUNCTION()
2142 rc = SQLExtendedFetch(result->stmt, SQL_FETCH_NEXT, 1, &crow,RowStatus); in PHP_FUNCTION()
2145 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2151 result->fetched++; in PHP_FUNCTION()
2154 switch(result->values[field_ind].coltype) { in PHP_FUNCTION()
2158 if (result->binmode <= 1) { in PHP_FUNCTION()
2161 if (result->binmode <= 0) { in PHP_FUNCTION()
2168 if (IS_SQL_LONG(result->values[field_ind].coltype)) { in PHP_FUNCTION()
2169 if (result->longreadlen <= 0) { in PHP_FUNCTION()
2172 fieldsize = result->longreadlen; in PHP_FUNCTION()
2175 PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(field_ind + 1), in PHP_FUNCTION()
2181 fieldsize = (result->longreadlen <= 0) ? 4096 : result->longreadlen; in PHP_FUNCTION()
2187 rc = SQLGetData(result->stmt, (SQLUSMALLINT)(field_ind + 1), sql_c_type, in PHP_FUNCTION()
2188 ZSTR_VAL(field_str), fieldsize, &result->values[field_ind].vallen); in PHP_FUNCTION()
2191 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2196 if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2205 if ((result->values[field_ind].coltype == SQL_LONGVARCHAR) in PHP_FUNCTION()
2207 || (result->values[field_ind].coltype == SQL_WLONGVARCHAR) in PHP_FUNCTION()
2216 field_str = zend_string_truncate(field_str, result->values[field_ind].vallen, 0); in PHP_FUNCTION()
2222 if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2225 RETURN_STRINGL(result->values[field_ind].value, result->values[field_ind].vallen); in PHP_FUNCTION()
2238 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(field_ind + 1),sql_c_type, field, fieldsize, &result-… in PHP_FUNCTION()
2241 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2246 if (result->values[field_ind].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2251 PHPWRITE(field,(rc == SQL_SUCCESS_WITH_INFO) ? 4095 : result->values[field_ind].vallen); in PHP_FUNCTION()
2267 odbc_result *result; in PHP_FUNCTION() local
2282 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2286 if (result->numcols == 0) { in PHP_FUNCTION()
2291 if (result->fetch_abs) in PHP_FUNCTION()
2292 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2295 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2309 for (i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2310 php_printf("<th>%s</th>", result->values[i].name); in PHP_FUNCTION()
2316 result->fetched++; in PHP_FUNCTION()
2318 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2320 switch(result->values[i].coltype) { in PHP_FUNCTION()
2324 if (result->binmode <= 0) { in PHP_FUNCTION()
2328 if (result->binmode <= 1) sql_c_type = SQL_C_BINARY; in PHP_FUNCTION()
2333 if (IS_SQL_LONG(result->values[i].coltype) && in PHP_FUNCTION()
2334 result->longreadlen <= 0) { in PHP_FUNCTION()
2340 buf = emalloc(result->longreadlen); in PHP_FUNCTION()
2343 …rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1),sql_c_type, buf, result->longreadlen, &result-… in PHP_FUNCTION()
2348 odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); in PHP_FUNCTION()
2354 PHPWRITE(buf, result->longreadlen); in PHP_FUNCTION()
2355 } else if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2359 PHPWRITE(buf, result->values[i].vallen); in PHP_FUNCTION()
2364 if (result->values[i].vallen == SQL_NULL_DATA) { in PHP_FUNCTION()
2367 php_printf("<td>%s</td>", result->values[i].value); in PHP_FUNCTION()
2375 if (result->fetch_abs) in PHP_FUNCTION()
2376 rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); in PHP_FUNCTION()
2379 rc = SQLFetch(result->stmt); in PHP_FUNCTION()
2383 RETURN_LONG(result->fetched); in PHP_FUNCTION()
2392 odbc_result *result; in PHP_FUNCTION() local
2399 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2403 if (result->values) { in PHP_FUNCTION()
2404 for (i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2405 if (result->values[i].value) { in PHP_FUNCTION()
2406 efree(result->values[i].value); in PHP_FUNCTION()
2409 efree(result->values); in PHP_FUNCTION()
2410 result->values = NULL; 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 SQLRowCount(result->stmt, &rows); in PHP_FUNCTION()
2796 odbc_result *result; in PHP_FUNCTION() local
2804 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2808 if (result->values) { in PHP_FUNCTION()
2809 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2810 if (result->values[i].value) { in PHP_FUNCTION()
2811 efree(result->values[i].value); in PHP_FUNCTION()
2814 efree(result->values); in PHP_FUNCTION()
2815 result->values = NULL; in PHP_FUNCTION()
2818 result->fetched = 0; in PHP_FUNCTION()
2819 rc = SQLMoreResults(result->stmt); in PHP_FUNCTION()
2821 rc = SQLFreeStmt(result->stmt, SQL_UNBIND); in PHP_FUNCTION()
2822 SQLNumParams(result->stmt, &(result->numparams)); in PHP_FUNCTION()
2823 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
2825 if (result->numcols > 0) { in PHP_FUNCTION()
2826 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
2827 efree(result); in PHP_FUNCTION()
2831 result->values = NULL; in PHP_FUNCTION()
2837 odbc_sql_error(result->conn_ptr, result->stmt, "SQLMoreResults"); in PHP_FUNCTION()
2848 odbc_result *result; in PHP_FUNCTION() local
2855 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2859 RETURN_LONG(result->numcols); in PHP_FUNCTION()
2867 odbc_result *result; in PHP_FUNCTION() local
2875 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2879 if (result->numcols == 0) { in PHP_FUNCTION()
2884 if (pv_num > result->numcols) { in PHP_FUNCTION()
2894 RETURN_STRING(result->values[pv_num - 1].name); in PHP_FUNCTION()
2902 odbc_result *result; in PHP_FUNCTION() local
2912 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2916 if (result->numcols == 0) { in PHP_FUNCTION()
2921 if (pv_num > result->numcols) { in PHP_FUNCTION()
2931 …PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)pv_num, SQL_COLUMN_TYPE_NAME, tmp, 31, &tmple… in PHP_FUNCTION()
2958 odbc_result *result; in PHP_FUNCTION() local
2965 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NU… in PHP_FUNCTION()
2969 if (result->numcols == 0) { in PHP_FUNCTION()
2975 for(i = 0; i < result->numcols; i++) { in PHP_FUNCTION()
2976 if (strcasecmp(result->values[i].name, fname) == 0) { in PHP_FUNCTION()
3101 odbc_result *result; in PHP_FUNCTION() local
3127 …if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_handle), "ODBC result", le_result)) ==… in PHP_FUNCTION()
3131 rc = SQLSetStmtOption(result->stmt, (unsigned short) pv_opt, pv_val); in PHP_FUNCTION()
3134 odbc_sql_error(result->conn_ptr, result->stmt, "SetStmtOption"); in PHP_FUNCTION()
3157 odbc_result *result = NULL; in PHP_FUNCTION() local
3172 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3174 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3176 efree(result); in PHP_FUNCTION()
3183 efree(result); in PHP_FUNCTION()
3192 rc = SQLTables(result->stmt, in PHP_FUNCTION()
3200 efree(result); in PHP_FUNCTION()
3204 result->numparams = 0; in PHP_FUNCTION()
3205 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3207 if (result->numcols > 0) { in PHP_FUNCTION()
3208 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3209 efree(result); in PHP_FUNCTION()
3213 result->values = NULL; in PHP_FUNCTION()
3215 result->conn_ptr = conn; in PHP_FUNCTION()
3216 result->fetched = 0; in PHP_FUNCTION()
3217 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3226 odbc_result *result = NULL; in PHP_FUNCTION() local
3241 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3243 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3245 efree(result); in PHP_FUNCTION()
3252 efree(result); in PHP_FUNCTION()
3263 rc = SQLColumns(result->stmt, in PHP_FUNCTION()
3271 efree(result); in PHP_FUNCTION()
3275 result->numparams = 0; in PHP_FUNCTION()
3276 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3278 if (result->numcols > 0) { in PHP_FUNCTION()
3279 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3280 efree(result); in PHP_FUNCTION()
3284 result->values = NULL; in PHP_FUNCTION()
3286 result->conn_ptr = conn; in PHP_FUNCTION()
3287 result->fetched = 0; in PHP_FUNCTION()
3288 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3298 odbc_result *result = NULL; in PHP_FUNCTION() local
3313 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3315 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3317 efree(result); in PHP_FUNCTION()
3324 efree(result); in PHP_FUNCTION()
3328 rc = SQLColumnPrivileges(result->stmt, in PHP_FUNCTION()
3336 efree(result); in PHP_FUNCTION()
3340 result->numparams = 0; in PHP_FUNCTION()
3341 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3343 if (result->numcols > 0) { in PHP_FUNCTION()
3344 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3345 efree(result); in PHP_FUNCTION()
3349 result->values = NULL; in PHP_FUNCTION()
3351 result->conn_ptr = conn; in PHP_FUNCTION()
3352 result->fetched = 0; in PHP_FUNCTION()
3353 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3364 odbc_result *result = NULL; in PHP_FUNCTION() local
3391 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3393 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3395 efree(result); in PHP_FUNCTION()
3402 efree(result); in PHP_FUNCTION()
3406 rc = SQLForeignKeys(result->stmt, in PHP_FUNCTION()
3416 efree(result); in PHP_FUNCTION()
3420 result->numparams = 0; in PHP_FUNCTION()
3421 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3423 if (result->numcols > 0) { in PHP_FUNCTION()
3424 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3425 efree(result); in PHP_FUNCTION()
3429 result->values = NULL; in PHP_FUNCTION()
3431 result->conn_ptr = conn; in PHP_FUNCTION()
3432 result->fetched = 0; in PHP_FUNCTION()
3433 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3444 odbc_result *result = NULL; in PHP_FUNCTION() local
3459 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3461 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3463 efree(result); in PHP_FUNCTION()
3470 efree(result); in PHP_FUNCTION()
3474 rc = SQLGetTypeInfo(result->stmt, data_type ); in PHP_FUNCTION()
3478 efree(result); in PHP_FUNCTION()
3482 result->numparams = 0; in PHP_FUNCTION()
3483 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3485 if (result->numcols > 0) { in PHP_FUNCTION()
3486 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3487 efree(result); in PHP_FUNCTION()
3491 result->values = NULL; in PHP_FUNCTION()
3493 result->conn_ptr = conn; in PHP_FUNCTION()
3494 result->fetched = 0; in PHP_FUNCTION()
3495 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3504 odbc_result *result = NULL; in PHP_FUNCTION() local
3518 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3520 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3522 efree(result); in PHP_FUNCTION()
3529 efree(result); in PHP_FUNCTION()
3533 rc = SQLPrimaryKeys(result->stmt, in PHP_FUNCTION()
3540 efree(result); in PHP_FUNCTION()
3544 result->numparams = 0; in PHP_FUNCTION()
3545 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3547 if (result->numcols > 0) { in PHP_FUNCTION()
3548 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3549 efree(result); in PHP_FUNCTION()
3553 result->values = NULL; in PHP_FUNCTION()
3555 result->conn_ptr = conn; in PHP_FUNCTION()
3556 result->fetched = 0; in PHP_FUNCTION()
3557 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3567 odbc_result *result = NULL; in PHP_FUNCTION() local
3586 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3588 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3590 efree(result); in PHP_FUNCTION()
3597 efree(result); in PHP_FUNCTION()
3601 rc = SQLProcedureColumns(result->stmt, in PHP_FUNCTION()
3609 efree(result); in PHP_FUNCTION()
3613 result->numparams = 0; in PHP_FUNCTION()
3614 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3616 if (result->numcols > 0) { in PHP_FUNCTION()
3617 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3618 efree(result); in PHP_FUNCTION()
3622 result->values = NULL; in PHP_FUNCTION()
3624 result->conn_ptr = conn; in PHP_FUNCTION()
3625 result->fetched = 0; in PHP_FUNCTION()
3626 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3637 odbc_result *result = NULL; in PHP_FUNCTION() local
3655 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3657 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3659 efree(result); in PHP_FUNCTION()
3666 efree(result); in PHP_FUNCTION()
3670 rc = SQLProcedures(result->stmt, in PHP_FUNCTION()
3677 efree(result); in PHP_FUNCTION()
3681 result->numparams = 0; in PHP_FUNCTION()
3682 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3684 if (result->numcols > 0) { in PHP_FUNCTION()
3685 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3686 efree(result); in PHP_FUNCTION()
3690 result->values = NULL; in PHP_FUNCTION()
3692 result->conn_ptr = conn; in PHP_FUNCTION()
3693 result->fetched = 0; in PHP_FUNCTION()
3694 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3705 odbc_result *result = NULL; in PHP_FUNCTION() local
3725 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3727 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3729 efree(result); in PHP_FUNCTION()
3736 efree(result); in PHP_FUNCTION()
3740 rc = SQLSpecialColumns(result->stmt, in PHP_FUNCTION()
3750 efree(result); in PHP_FUNCTION()
3754 result->numparams = 0; in PHP_FUNCTION()
3755 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3757 if (result->numcols > 0) { in PHP_FUNCTION()
3758 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3759 efree(result); in PHP_FUNCTION()
3763 result->values = NULL; in PHP_FUNCTION()
3765 result->conn_ptr = conn; in PHP_FUNCTION()
3766 result->fetched = 0; in PHP_FUNCTION()
3767 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3777 odbc_result *result = NULL; in PHP_FUNCTION() local
3796 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3798 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3800 efree(result); in PHP_FUNCTION()
3807 efree(result); in PHP_FUNCTION()
3811 rc = SQLStatistics(result->stmt, in PHP_FUNCTION()
3820 efree(result); in PHP_FUNCTION()
3824 result->numparams = 0; in PHP_FUNCTION()
3825 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3827 if (result->numcols > 0) { in PHP_FUNCTION()
3828 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3829 efree(result); in PHP_FUNCTION()
3833 result->values = NULL; in PHP_FUNCTION()
3835 result->conn_ptr = conn; in PHP_FUNCTION()
3836 result->fetched = 0; in PHP_FUNCTION()
3837 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()
3847 odbc_result *result = NULL; in PHP_FUNCTION() local
3861 result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); in PHP_FUNCTION()
3863 rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt)); in PHP_FUNCTION()
3865 efree(result); in PHP_FUNCTION()
3872 efree(result); in PHP_FUNCTION()
3876 rc = SQLTablePrivileges(result->stmt, in PHP_FUNCTION()
3883 efree(result); in PHP_FUNCTION()
3887 result->numparams = 0; in PHP_FUNCTION()
3888 SQLNumResultCols(result->stmt, &(result->numcols)); in PHP_FUNCTION()
3890 if (result->numcols > 0) { in PHP_FUNCTION()
3891 if (!odbc_bindcols(result)) { in PHP_FUNCTION()
3892 efree(result); in PHP_FUNCTION()
3896 result->values = NULL; in PHP_FUNCTION()
3898 result->conn_ptr = conn; in PHP_FUNCTION()
3899 result->fetched = 0; in PHP_FUNCTION()
3900 RETURN_RES(zend_register_resource(result, le_result)); in PHP_FUNCTION()