0
我写了下面的代码,当它运行时,无论SQL查询是什么,我都会得到“错误:查询是空的”。我知道生成的SQL很好,因为如果我将它粘贴到SQL数据库中,它将返回行。记录集的PHP代码已从其他工作正常的页面粘贴,因此我无法查看错误的位置。PHP记录集返回“错误:查询是空的”
壳体4://检查是否用户先前已加载的清单
$mySQL = "SELECT * FROM tools_userChklists WHERE chklistID = '" . $_GET['chklistID'] . "'";
echo $mySQL;
$query_rsChecklists = $mySQL;
$rsChecklists = mysql_query($query_rsChecklists) or die(mysql_error());
$row_rsChecklists = mysql_fetch_assoc($rsChecklists);
$totalRows_rsChecklists = mysql_num_rows($rsChecklists);
if ($totalRows_rsChecklists <> 0){
//the user has already opened this checklist
$_SESSION['redirectorAction'] = "";
$_SESSION['redirectorAction'] = "Location: actions.php?action=5&chklistID=" . $_GET['chklistID'];
}else{
//the user has never opened this checklist
$_SESSION['redirectorAction'] = "";
$_SESSION['redirectorAction'] = "Location: actions.php?action=6&chklistID=" . $_GET['chklistID'];
}
break;
任何帮助理解。谢谢。
如前所述,我已经使用相同的格式代码记录几年现在没有问题。我会试一试,但我不太确定它会有所作为。感谢您的输入。 – MingMing 2011-12-29 23:23:48