作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在做2个查询
CALCULA_DEPARTAMENTO.PHP
$consulta= "SELECT * FROM Dept INNER JOIN Userinfo
ON Userinfo.Deptid = Dept.Deptid
where Dept.DeptName = '$departamento'";
$rs=odbc_exec($conn,$consulta);
if (!$rs)
{exit("Connection Failed: " . $rs);}
while (odbc_fetch_row($rs))
{
session_start();
ob_start();
$_SESSION['departamento'] = $departamento;
include_once("calcula_cono.php");
calcularr();
}
odbc_close($conn);
function calcularr()
{
$departamento = $_SESSION['departamento'];
$consultaa = "SELECT * FROM Checkinout, Userinfo
where Checkinout.Userid = '$userid' AND
Userinfo.userid = '$userid' AND
Checkinout.Checktime BETWEEN CDate('$fecha_inicio') AND
CDate('$fecha_fin')";
$rss=odbc_exec($conn,$consultaa);
if (!$rss)
{exit("Connection Failed: " . $rss);}
while (odbc_fetch_row($rss))
{ //more things here
}
}
Warning: odbc_fetch_row(): 4 is not a valid ODBC result resource
最佳答案
It finishes the first iteration and it does it well... but when he has to do the second one i get this error:
while
循环中的某些代码行正在破坏结果变量
$rss
(或可能是
$rs
,具体取决于哪个
odbc_fetch_row()
调用失败)。仔细检查代码,以确保您不会在循环内无意中将值分配给结果变量。
关于php - 警告: odbc_fetch_row(): 4 is not a valid ODBC result错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19305446/
总而言之,在 PHP 中将 odbc_fetch_row() 与 SQL Server 2012 结合使用时,循环 525 个结果需要 17 秒。 环境: Mac OS X 10.9 Apache(随
我正在做2个查询 CALCULA_DEPARTAMENTO.PHP $consulta= "SELECT * FROM Dept INNER JOIN Userinfo ON
我是一名优秀的程序员,十分优秀!