可能重複:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
mysql_num_rows(): supplied argument is not a valid MySQL result resource
Warning: mysql_fetch_* expects parameter 1 to be resource, boolean given errorSQL錯誤消息未知我: 「警告:mysql_num_rows():提供的參數不是一個有效的MySQL結果資源」
我想通過一個身份證,通過我收到我不知道的錯誤消息的網址。我的代碼如下:
<?php
$result = mysql_query("SELECT * FROM Agendas INNER JOIN Meetings ON Meetings.meeting_id = Agendas.meeting_id WHERE approval = 'pending' ORDER BY Agendas.meeting_id DESC")
or die(mysql_error());
if (mysql_num_rows($result) == 0) {
echo '<h2>No Action Is Required Yet</h2>';
} else {
while($info = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td><br/>" .'Meeting Title: '. $info['title']." </td>";
echo "<td><br/><br/>" .'<a href="viewagenda.php?agenda_id=' . $info['agenda_id'] . '">View Agenda</a> '." </td>";
echo "<hr>";
}
}
echo "</tr>";
echo "</table>";
?>
viewagenda.php如下:
<?php
$id = $_GET['agenda_id'];
$query = mysql_query("SELECT * FROM Agendas INNER JOIN Meetings ON Meetings.meeting_id = Agendas.meeting_id WHERE agenda_id = '$id'")
or die(mysql_error());
if (mysql_num_rows($result) == 0) {
echo '<hr><h2>There Arent Any Agendas For This Meeting Yet</h2>';
} else {
while($info = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td><br/>" .'Title: '. $info['title']." </td>";
echo "<td><br/>" .'Subject: '. $info['subject']. "</td>";
echo "<td><br/>" .'Duration: '. $info['duration']. "</td>";
echo "<hr>";
}
}
echo "</tr>";
echo "</table>";
?>
錯誤消息我得到的是:
「警告:mysql_num_rows():提供的參數不是E:\ webareas \ hj942 \ conference \ Chairperson \ viewagenda.php在線70'上的有效MySQL結果資源
我的表格如下:
會議:MEETING_ID,稱號,會長,祕書長,occurances
議程:agenda_id,主題,時間,MEETING_ID
什麼是「\ viewagenda.php」中的第70行? – Robert 2012-01-04 16:47:58
**請參閱右邊的相關專欄 - > ** – hakre 2012-01-04 16:52:17