我是PHP的新手,所以我为混乱的代码道歉..
我不知道如何解决这个错误:
警告:mysql_fetch_array() 期望参数 1 是资源,布尔值在第 6 行的 C:\xampp\htdocs\final2\ah.php 中给出
请帮助我了解如何解决这个问题。
这是我的php代码:
<?php
include('config_db.php');
$today = (date('Y-m-d'));
$query = "select * from inventory.reservation,inventory.machine where inventory.reservation.item_code = inventory.machine.item_code and inventory.reservation.date_to > '$today'";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{
$this->avail_num = $row['avail_num'] + $row['num_reserve'];
$this->num_reserve = 0;
}
$query = "delete from inventory.reservation where num_reserve = 0";
mysql_query($query) or die('<p>ERROR, query Failed</p>');
?>