【发布时间】:2014-01-10 19:39:52
【问题描述】:
在这里,我试图从用户那里获取订单信息,然后通过确认订单,我想向用户显示订单 ID 作为订单的跟踪...但它显示了如上所述的错误 我的代码在这里:
<?php
// This block grabs the whole list for viewing
$product_list1 = "";
$sql = mysql_query("SELECT FROM orders ORDER BY id DESC LIMIT 1");
$orderCount = mysql_num_rows($sql);
if ($orderCount > 0) {
while($row = mysql_fetch_array($sql)){
$id = $row["id"];
$product_list1 .= "Your Order ID : $id ";
}
} else {
$product_list1 = "You have no products listed in your store yet";
}
?>
【问题讨论】:
-
SELECT [what] FROM.. 可能缺少 *?
-
太多重复了!发帖前先搜索
-
@SmokeyPHP 你在第二句后面少了一个感叹号。