01.
<html>
02.
<head>
03.
<title>ThaiCreate.Com Tutorial</title>
04.
</head>
05.
<?
06.
mysql_connect(
"localhost"
,
"root"
,
"root"
)
or
die
(mysql_error());
07.
mysql_select_db(
"mydatabase"
);
08.
?>
09.
<body>
10.
<form action=
"phpLlistmenuDatebase2.php"
method=
"post"
name=
"form1"
>
11.
List Menu<br>
12.
<select name=
"lmName1"
>
13.
<option value=
""
><-- Please Select Item --></option>
14.
<?
15.
$strSQL
=
"SELECT * FROM customer ORDER BY CustomerID ASC"
;
16.
$objQuery
= mysql_query(
$strSQL
);
17.
while
(
$objResuut
= mysql_fetch_array(
$objQuery
))
18.
{
19.
?>
20.
<option value=
"<?=$objResuut["
CustomerID
"];?>"
><?=
$objResuut
[
"CustomerID"
].
" - "
.
$objResuut
[
"Name"
];?></option>
21.
<?
22.
}
23.
?>
24.
</select>
25.
<input name=
"btnSubmit"
type=
"submit"
value=
"Submit"
>
26.
</form>
27.
</body>
28.
</html>
29.
<?
30.
mysql_close();
31.
?>