0
我试图从订单表中打印出Product_Name和Order_Date,但不断收到第35行的错误“num_rows线”。尝试在内部连接语句上尝试获取非对象属性的错误
<?php
$servername = "localhost";
$username='root';
$password = "";
$dbname = "login";
?>
<html><<html>
<head>
<title>Cart</title>
<link rel="stylesheet" href="tabMenu.css" type="text/css">
</head>
<body>
</body>
</html>
<?php
$mysqli = new mysqli($servername,$username, Null, $dbname);
// Check connection
if ($mysqli->connect_error) {
die("Connection failed: " . $mysqli->connect_error);
}
session_start();
$results="Select orderline.Order_Date,p.Product_Name"
. "from orderline"
. "inner join product p"
. "on orderline.Product_ID=p.Product_ID";
$num=$mysqli->query($results);
if ($results->num_rows)
{
while ($row=$results->fetch_object())
{
echo "{$row->Order_Date} {$row->Product_ID} <br>";
}
}
else
{
echo "No Results";}
在此先感谢任何帮助将是伟大的。