最近在做PHP课程设计,最购物网站,本人菜鸟,所以回答的时候能详细点吗?最好带代码的,谢谢。
这个界面代码是这样:
<?php
$conn=mysql_connect('localhost','root','123')or die('连接失败');
mysql_select_db('mysql',$conn)or die('连接失败');
mysql_query("SET NAMES utf8");
$sql="select * from goods";
$result=mysql_query($sql);
echo "<html>";
echo "<head>";
echo "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>";
echo "<body>";
echo "<form name='form1' method='post' >";
echo "<table border=3 align='center'>";
echo "<tr><td>商品编号</td><td>商品名称</td><td>商品价格(元)</td><td>数量</td><td>购物篮</td></tr>";
while($row=mysql_fetch_row($result))
{
echo "<tr><td>$row[0]</td><td>$row[1]</td><td>$row[2]</td><td><input type='text' name='text' ></td><td><input type='checkbox' name='checkbox'></td></tr>";
}
echo "</table>";
echo "<input type='submit' value='确定订购'>";
echo "</form>";
echo "</body>";
echo "</head>";
echo "</html>";
?>
-----------------------
我想问的是:怎样把打钩的选项,放入数据库,包括数量。
最好能给出代码,谢谢你们,本人菜鸟啊!!!