|
 |
|
update listbox แสดงค่าเก่าได้ แต่ไม่สามารถบันทึกค่าที่ update ได้ค่ะ |
|
 |
|
|
 |
 |
|
update listbox แสดงค่าเก่าได้ แต่ไม่สามารถบันทึกค่าที่ update ได้ค่ะ
Code (PHP)
$protocol_date=$_POST["protocol_date_day"];
$protocol_date.=$_POST["protocol_date_month"];
$protocol_date.=$_POST["protocol_date_year"];
Code (PHP)
$pro_date= $row_show['protocol_date'];//วันที่ลงรับ
$year = substr($pro_date , 4 ); // ได้ค่า ปี 2013
$month2 = substr($pro_date , -5,1 ); // ได้ค่า เดือนตัวที่ 2
$month1 = substr($pro_date , -6,1 ); // ได้ค่า เดือนตัวแรก
$day2 = substr($pro_date , -7,1 ); // ได้ค่า วันที่ตัวที่สอง
$day1 = substr($pro_date , -8,1 ); // ได้ค่า วันที่ตัวแรก
$month = $month1.$month2; //ค่าเืดือน
$day = $day1.$day2; //ค่าวันที่
$now=$month.$day;
Code (PHP)
select name="protocol_date_day" id="protocol_date_day">
<?php
for($i = 1 ; $i <= 31 ; $i++){
?>
<option value="<?=$day;?>"<? if($i==$day){ echo "selected";} ?>><? echo $i;?></option>
<?
}
?>
</select>
<select name="protocol_date_month" id="protocol_date_month">
<?
$months = array('','มค.', 'กพ.', 'มีค.', 'เมย.', 'พค.', 'มิย.', 'กค.', 'สค.', 'กย.', 'ตค.', 'พย.', 'ธค.');
for($im = 1; $im <= 12; $im++){
?>
<option value="<?=$month;?>"<? if($im==$month){ echo "selected";} ?>><? echo $im;?></option>
<?
}
?>
</select>
<select name="protocol_date_year" id="protocol_date_year">
<?
for($iy = 2000; $iy <= 2050 ; $iy++){
?>
<option value="<?=$year;?>"<? if($iy==$year){ echo "selected";} ?>><? echo $iy;?></option>
<?
}
?>
</select>
Tag : PHP, MySQL

|
|
 |
 |
 |
 |
Date :
2013-11-06 13:57:24 |
By :
momiya123 |
View :
729 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
บรรทัดที่ 6 $day มาจากไหน
บรรทัดที่18 $month มาจากไหน
บรรทัดที่ 29 $year มาจากไหน
ถ้ามันคือ ตัวแปรวันที่เก่าที่ดึงมาจากฐานข้อมูลหละก็ . .. . แล้วเวลาเปลี่ยนหละจะเก็บลงไหนเพราะตรงนี้กิน Value ของ List box ไปหมดเลย
|
 |
 |
 |
 |
Date :
2013-11-06 14:23:44 |
By :
meannerss |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|