01.
<html>
02.
<head>
03.
<meta charset=
"utf-8"
>
04.
<title>Test Celect Contry</title>
05.
</head>
06.
07.
<body>
08.
<?php
09.
include
(
'./inc.php'
);
10.
?>
11.
<form action=
"<?=$_SERVER['PHP_SELF'];?>"
method=
"post"
>
12.
<p>เลือกประเทศ ภาษาไทย :
13.
<select name=
"TH"
required>
14.
<?php
15.
$thSQL
=
"SELECT * FROM tbl_country"
;
16.
$thQuery
=mysqli_query(
$connec
,
$thSQL
);
17.
while
(
$thARR
=mysqli_fetch_array(
$thQuery
)){
18.
echo
(
"<option value='$thARR[ct_code]'>$thARR[ct_nameTHA]</option>"
);
19.
}
20.
?>
21.
</select>
22.
</p>
23.
<p>เลือกประเทศ Englist :
24.
<select name=EN required>
25.
<?php
26.
$enSQL
=
"SELECT * FROM tbl_country"
;
27.
$enQuery
=mysqli_query(
$connec
,
$enSQL
);
28.
while
(
$thARR
=mysqli_fetch_array(
$enQuery
)){
29.
echo
(
"<option value='$thARR[ct_code]'>$thARR[ct_nameENG]</option>"
);
30.
}
31.
?>
32.
</select>
33.
</p>
34.
</form>
35.
</body>
36.
</html>