我一直在這個項目上工作了很長一段時間,仍然陷在這段代碼中。此處,我可以展示產品列表頁:從列表中選擇產品
@mysql_connect("localhost", "root", "") or die();
@mysql_select_db("product") or die();
$result=mysql_query("select * from product_list ORDER BY name ASC");
while($row=mysql_fetch_array($result)){
a href="show.php?code=$row['serial']|$row['name']
$row['description']
show.php是:
//connect to server and select database; you may need it
@mysql_connect("localhost", "root", "") or die();
@mysql_select_db("bibendum") or die();
$serial = intval($_GET['serial']);
$query = "SELECT serial, name, desription FROM product_list WHERE serial = {$serial}";
echo "{$row[name]}";
我得到這個錯誤:
Notice: Undefined index: serial in show.php on line 7
Notice: Undefined index: serial in show.php on line 8
Notice: Use of undefined constant name - assumed 'name' in show.php on line 10
Notice: Undefined variable: row in show.php on line 10