我不知道为什么会出现这个错误:mysql_num_row():supplied argument is not a valid MySQL result resource
$sqlCheckLevel = 'SELECT * FROM levelPerClass WHERE clsId = \''.$class.'\' AND lvlId = \''.$rowLevel['lvlId'].'\'';
$resCheckLevel = mysql_query($sqlCheckLevel);
print_r($rowCheckLevel = mysql_fetch_assoc($resCheckLevel));
//prints 'Array ( [clsId] => 15 [lvlId] => 18 )'
if(mysql_num_rows($rowCheckLevel) == 0) {
//etc
怎么了?
编辑: 我觉得很愚蠢。它需要是
if(mysql_num_rows($resCheckLevel) == 0) {