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重新编辑 ]
|