 |
|
ถ้าผมทำวันที่เป็น drop down menu โดยที่ value ของวันเป็นเลขสองหลังเช่น 06 เดือนเป็น อักษร 3 ตัวเช่น May และปีเป็นเลข สี่หลัก เช่น 1985
ผมควรจะเขียน code อย่างไร และกำหนดค่าที่ phpMyadmin อย่างไรครับ (ค่าที่ PhpMyadmin เช่น varchar 255)
ตัวอย่าง form

และนี้เป็น code ที่ผมลองเขียนแต่มันไม่เก็บค่า value ของวันเดือนปีมาให้
<?
if($txtName=="" || $txtSurname=="" || $txtBaby=="" || $gender=="" || $day=="" || $month==""|| $year=="" || $Phone=="" || $CellPhone=="" || $txtEmail=="" || $txtAddress=="" || $txtZipcode=="")
{
print ("Pleasd fill the form<br>");
}
else
{
$link=mysql_connect("localhost","","");
if (!$link)
{
print ("Can't connect the Database.");
}
else
{
mysql_select_db("ชื่อ database",$link);
$sql="insert into ชื่อตาราง (txtName,txtSurname,txtBaby,gender,day,month,year,Phone,CellPhone,txtEmail,txtAddress,txtZipcode)
values ('$txtName','$txtSurname','$txtBaby','$gender','day','month','year','$Phone','$CellPhone','$txtEmail','$txtAddress','$txtZipcode')";
$res= mysql_query ($sql);
if ($res==1)
print ("Thank! for your information");
else
print ("Sorry! Out off Service");
}
}
?>
ขอบคุณมากครับ
Tag : - - - -
|
|
 |
 |
 |
 |
Date :
2009-05-07 01:31:36 |
By :
idzstar |
View :
4692 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |