我写了一个查询,但出现以下错误,有什么想法吗?!
错误 :
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in E:\AppServ\www\admin\index.php on line 545
代码 :
require_once '../_db/databaseConnect.php';
$db = new databaseConnect();
$db->connect();
$queryResult = mysql_query("(SELECT * FROM tabelcomments WHERE publishStatus = 2) UNION (SELECT appTitleFa FROM tableapps WHERE appID = '$appID');");
for ($dataCnt = 0; $dataCnt < mysql_num_rows($queryResult); $dataCnt++)
{
//codes...
}
$db->close();