apower111
|
分享:
▼
x0
|
[求助] 好心的大大救救我吧!
【類型】主程式 【版本】其他
<html> <head> <title>組裝試算</title> <meta http-equiv="Content-Type" content="text/html; charset=Big5">
<style type="text/css"> <!-- .style1 {font-size:16; font-family:新細明體;} .w1{width:20%;text-align:right;} .w2{width:20%;text-align:right;letter-spacing:16px;} .w3{width:80%;} --> </style> </head> <body>
<table width="75%" align="center"> <tr><td> <table width="100%" bgcolor="EDF9FF"> <tr><td colspan="4" align="center" bgcolor="29BEDE">商品目錄 <tr><td colspan="4" align="center"> <? $link = mysql_connect("localhost","root","****","eq"); mysql_select_db("sql",$link); $sql = "SELECT *FROM detail"; $flag = false; while ($row = $dao->getRecord() ) { if ($flag) { $flag = false; $color = "#FF99CC"; } else { $flag = false; $color = "#99FFC"; } //顯示選購商品的表單 ?> <form action="save.php" method="post"> <input type="hidden" name="P_NUM" value="<? echo $row["P_NUM"] ?>"> <input type="hidden" name="TOTAL" value="<? echo $row["TOTAL"] ?>"> <input type="hidden" name="AMOUNT" value="<? echo $row["AMOUNT"] ?>"> <tr bgcolor="<? echo $color ?>"> <td><? echo $row["P_NUM"] ?></td> <td><? echo $row["TOTAL"] ?></td> <td><? echo $row["AMOUNT"] ?></td> <td valign="top"> <input type="text" size=5 name="Quantity" value="1"></td> <td valign="top"> <input type="checkbox" value="">保留 <tr><td align="right"> <input type="submit" value="確定"> </td> </tr> </form> </table> <? } ?> <tr><td> <table width="100%" align="center" bgcolor="#DCDCDC"> <tr align="center"><td><a href="">首頁</a><td>| <td><a href="">關於我們</a><td>| <td><a href="">網站導覽</a><td>| <td><a href="">客服中心</a> </table> </body> </html>
以上是小弟我在寫網頁的一部份,執行時出現錯誤,是在while那一行,我不知道是錯在那裡? 希望好心的大大能幫忙一下
<? require_once("../DataAccess.php"); 1 $dao = new DataAccess("localhost","root","****","eq"); 2 (1和2的改變是沒影響) $sql = "SELECT *FROM detail"; $dao->fetchDB($sql); (原來是這樣的,但被我改成下面那個程式,會變這行有錯) $flag = false; while ($row = $dao->getRecord() ) { if ($flag) { $flag = false; $color = "#FF99CC"; } else { $flag = false; $color = "#99FFC"; } //顯示選購商品的表單 ?>
小弟我把程式修改成這樣,但修改會有什麼錯誤嗎?
<? $link = mysql_connect("localhost","root","****","eq"); mysql_select_db("sql",$link); $sql = "SELECT *FROM detail"; $flag = false; while ($row = $dao->getRecord() ) { if ($flag) { $flag = false; $color = "#FF99CC"; } else { $flag = false; $color = "#99FFC"; } //顯示選購商品的表單 ?>
[ 此文章被apower111在2007-09-01 22:09重新編輯 ]
|