<?php require_once('Connections/connect.php'); ?>
<?php
$id_truck = mysql_real_escape_string($_GET['id_truck']);
$sql_PK = "SELECT * FROM tbl_truck WHERE id_truck = '{$id_truck}'";
$res_PK = mysql_query($sql_PK, $connect);
$row_PK = mysql_fetch_assoc($res_PK);
$truck_plate = $row_PK['truck_plate_no'];
$truck_plate = mysql_real_escape_string($truck_plate);
$sql = "SELECT tbl_truck.truck_plate_no,
tbl_delivery_details.delivery_details_route,
tbl_delivery_details.delivery_details_destination,
tbl_delivery_details.delivery_details_van_no,
tbl_delivery_details.delivery_details_waybill_no,
tbl_delivery_details.delivery_details_charge_invoice,
tbl_delivery_details.delivery_details_revenue,
tbl_delivery_details.delivery_details_strip_stuff,
tbl_delivery_details.delivery_details_date
FROM tbl_truck, tbl_delivery_details
WHERE tbl_truck.truck_plate_no = tbl_delivery_details.tbl_truck_id_truck
AND tbl_truck.truck_plate_no = '{$truck_plate}'";
$res = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($res);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Truck Delivery</title>
<link rel="stylesheet" type="text/css" href="qcc.css"/>
</head>
<body>
<?php echo $row_PK['delivery_details_route'];?>
</body>
</html>
mysql_fetch_assoc() 期望参数 1 是资源,布尔值在第 9 行的 C:\xampp\htdocs\qcc\truckdelivery.php 中给出,没有选择数据库
我不知道我在哪里弄错了代码;此页面是我制作的充满车牌号的表格中的链接,我使用此代码将车牌号变成了链接。
href="truckdelivery.php?id_truck=<?php echo $row_truck['id_truck']?>"><?php echo $row_truck['truck_plate_no'];