|
 |
|
จะเขียนยังไงให้สามารถแก้ไขข้อมูลได้ เพราะตอนนี้เพิ่มข้อมูลได้อย่างเดียว |
|
 |
|
|
 |
 |
|
Code (PHP)
<?php
//$rows['Birthdate'] ="1986-02-12";
$Birthdate = explode('-', $rows['Birthdate']);
$d = $Birthdate[2];
$m = $Birthdate[1];
$y = $Birthdate[0]+543;
$month = array("","มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน",
"กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม");
?>
<select name="BirthDay" id="BirthDay" onChange="getAge()">
<option value='null'>==เลือกวัน==</option>
<?php foreach (range (1, 31) as $resl) {
?>
<option value="<?=$resl?>" <?if($resl ==$d) echo "selected"?>>
<?=$resl?>
</option>
<?php } ?>
</select>
<select name="BirthMonth" id="BirthMonth" onChange="getAge()">
<option value='null'>==เลือกเดือน==</option>
<?php foreach ($month as $key=>$resl) { ?>
<option value="<?=$key?>" <?if($key ==$m-1) echo "selected"?>>
<?=$resl?>
</option>
<?php } ?>
</select>
<select name="BirthYear" id="BirthYear" onChange="getAge()">
<option value='null' >==เลือกปี==</option>
<?php foreach (range (2549, 2550) as $resl) { ?>
<option value="<?=$resl?>" <?if($resl ==$y) echo "selected"?>> <?=$resl?> </option>
<?php } ?> </select>
<? //***************************************************************************** ?><label>
<input type="text" name="txtAge" id="txtAge" ><script>getAge();</script>
<input type="hidden" name="txtAge1" id="txtAge"><script>getAge();</script>
</label>
Tag : PHP

|
|
 |
 |
 |
 |
Date :
2012-06-13 08:44:20 |
By :
nunam |
View :
898 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
insert update delete sql command
|
 |
 |
 |
 |
Date :
2012-06-13 09:40:41 |
By :
Dragons_first |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|