什么我的本意是把一个表在我的网站方含由含有一个ID我是什么,他PHP的MySQL做错了
$con = mysqli_connect('hostname','username','password','dbname');
if (!$con) {
die('Could not connect: ' . mysqli_error($con));
}
$sql="SELECT * FROM Orders WHERE `Student UID` = '".$id."'";
$result = mysqli_query($con,$sql);
echo
echo "<table><tr><th>Product</th><th>Cost</th></tr>";
while($row = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['MenuItemName'] . "</td>";
echo "<td>" . $row['Price'] . "</td>";
echo "</tr>";
}
echo "</table>";
此刻datbase某些字段,当我运行此,我上午突出部分得到一个表像这样
+---------+-------+
| Product | Price |
+---------+-------+
我的数据库看起来像这样
+--------------+-------+-------------+
| MenuItemName | Price | Student UID |
+--------------+-------+-------------+
| Foo | 99 | 12345 |
| Foo2 | 11 | 11111 |
| Foo2 | 11 | 12345 |
+--------------+-------+-------------+
我在做什么毛病日是什么?
旁注:''学生UID'' – Ghost
对不起娜市长@RodrigoDuterte哈哈 – KaeL