///////////สร้างฐานข้อมูล////////////////
CREATE TABLE `product` (
`product_id` int(3) NOT NULL default '0',
`product_name` varchar(225) NOT NULL default '',
`product_cost` decimal(10,2) NOT NULL default '0.00',
`product_unit` varchar(125) NOT NULL default '',
PRIMARY KEY (`product_id`)
) TYPE=MyISAM;
#
# dump ตาราง `product`
#
INSERT INTO `product` VALUES (1, 'A', '10.00', 'g.');
INSERT INTO `product` VALUES (2, 'B', '15.00', 'kg.');
INSERT INTO `product` VALUES (3, 'C', '8.00', 'bag');
/////////////ส่วนของโค้ดโปรแกรมจ้า/////////
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body>
สินค้า :
<select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
<option value="<? echo"?";?>">++++เลือกสินค้า</option>
<? $link = mysql_connect("localhost","","") or die ("Could not connect!!");
$dbname=mysql_select_db("test")or die ("Could not select database!!");