Possible Duplicate:
PHP: Warning: sort() expects parameter 1 to be array, resource given警告:mysql_fetch_array()预计参数1是资源,布尔在等给出
我得到的错误:
警告:mysql_fetch_array()预计参数1是资源,布尔在C中给出: \ allthewaytthroughmyfolders \ WWW \ filterresultaat.php上线103
while ($regel = mysql_fetch_array ($filterres))
{
echo
'<tr>
<td>'
.$regel['Opleiding'].
'</td>
<td>'
.$regel['S_datum'].
'</td>
<td>'
.$regel['Duur'].
'</td>
<td>'
.$regel['omschrijving'].
'</td>
<td>'
.$regel['vergoeding'].
'</td>
<td>'
.$regel['Stad'].
'</td>
<td>'
.$regel['Straat'].
'</td>
<td>'
.$regel['Huisnr'].
'</td>
<td>'
.$regel['postcode'].
'</td>
<td>'
.$regel['land'].
'</td>
<td>'
.$regel['contactpersoon'].
'</td>
</tr>';
}
这是奇怪的,因为它是一个小时前的工作。
任何人都可以帮忙吗?
编辑:
if (isset($opleiding))
{ $opleidingq = 'opleiding = "'.$opleiding.'" and'; }
if (isset($duur))
{
if($duur = 30)
{
$duurq = ' ';
}
else
{
$duurq= 'duur= "'.$duur.'" and';
}
}
else
{ $duurq = ' ';
}
if (isset($type))
{ $typeq= 'type= "'.$type.'" and'; }
$filter = "SELECT * FROM opdracht WHERE $opleidingq $duurq $typeq gevuld ='nee';";
//mysql_query($filter);
$filterres = mysql_query($filter);
您可以发布'$ filterres' var的代码吗? – Nexerus
另请参阅[this](http://stackoverflow.com/questions/3899923/php-error-mysqli-num-rows-expects-parameter-1-to-be-mysqli-result-boolean-giv)或[this ](http://stackoverflow.com/questions/4988425/mysql-query-boolean-given) –
尝试var_dump($ filterres)。如果它为空或只是没有查询结果,则查询失败。也许WHERE语句可能会引发错误,请尝试删除它! – Anonymous