|
![](/images/resource/spacer.gif) |
|
สอบถามเรื่องการดึงค่าจากฐานข้อมูล แบบ Radio Button หน่อยครับ |
|
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
Code (PHP)
<input name="Radio_Type" type="radio" value="1"<? if($Radio_Type=="1") echo " checked"; ?>>
<input name="Radio_Type" type="radio" value="2"<? if($Radio_Type=="2") echo " checked"; ?>>
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2015-04-22 10:58:59 |
By :
LAGO |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
$Radio_Type == "รายวัน" กับ $Radio_Type=="1"
จะเทียบอะไร ก็ต้องดูว่า $Radio_Type ส่งค่าอะไรมาครับ
ส่ง รายวัน รายเดือน 1 หรือ 2
ค่า $Radio_Type ผ่านการดึงข้อมูล คิวรี่จากตรงไหน
มันควรจะเป็น $row_Employee['Radio_Type']; หรือเปล่า
|
ประวัติการแก้ไข 2015-04-22 11:55:30
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2015-04-22 11:51:12 |
By :
apisitp |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
ประยุกต์เอาจากของผมครับ ตาม No.3 ลองใส่เข้าไปดู หรือไม่เอาโค้ดหน้า edit มาดูหน่อยครับ แล้วในฐานข้อมูลเก็บเป็นอะไรครับ 1 กับ 2 หรือเปล่า
|
ประวัติการแก้ไข 2015-04-22 12:06:29
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2015-04-22 12:02:21 |
By :
LAGO |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
<input name="Type_Name" type="radio" value="รายวัน" <? if($row_Employee['Type_Name']=="1" ) echo " checked"; ?>> รายวัน
<input name="Type_Name" type="radio" value="รายเดือน" <? if($row_Employee['Type_Name']=="2") echo " checked"; ?>> รายเดือน
ชื่อฟิลด์ที่เก็บค่า Radio ในตารางฐานข้อมูล ของคุณ ชื่อ ว่าอะไรครับ ??
|
ประวัติการแก้ไข 2015-04-22 14:58:11 2015-04-22 15:01:16 2015-04-22 15:01:57
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2015-04-22 14:57:12 |
By :
apisitp |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
คุณก็ดึงค่า Type_ID มาแทนสิครับ ดึงค่า คิวรี่อ่ะครับ
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2015-04-22 23:17:37 |
By :
apisitp |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
เรียก Type_ID ก็ได้แล้วเพราะคุณเก็บไอดี เป็น 1 และ 2 ใน ตาราง register
Code (PHP)
<input name="Type_ID " type="radio" value="1"<? if($row_Employee['Type_ID']=="1") echo " checked"; ?>> รายวัน
<input name="Type_ID " type="radio" value="2"<? if($row_Employee['Type_ID']=="2") echo " checked"; ?>> รายเดือน
|
ประวัติการแก้ไข 2015-04-23 00:05:44
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2015-04-23 00:04:56 |
By :
LAGO |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
![](/images/bbcode/cool.gif?v=1001) ![](/images/bbcode/cool.gif?v=1001) ![](/images/bbcode/cool.gif?v=1001)
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2015-04-23 08:12:29 |
By :
apisitp |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
![](/images/bbcode/lol.gif?v=1001) ![](/images/bbcode/lol.gif?v=1001)
ขอบคุณท่าน apisitp และ LAGO มากๆนะครับ
ถ้าใช้ในรูปแบบนี้ ค่าที่ผมลองแก้ไข และบันทึกเป็น 0
<input name="Type_ID" type="radio" value="1"<? if($row_Employee['Type_ID']=="1") echo " checked"; ?>> รายวัน
<input name="Type_ID" type="radio" value="2"<? if($row_Employee['Type_ID']=="2") echo " checked"; ?>> รายเดือน
--------------------------------------------------------------------------------------------------------------------------------------
ผมลองเปลี่ยน name เป็น edit_type ตอนนี้ได้เรียบร้อยละครับ
<input name="edit_type" type="radio" value="1"<? if($row_Employee['Type_ID']=="1") echo " checked"; ?>> รายวัน
<input name="edit_type" type="radio" value="2"<? if($row_Employee['Type_ID']=="2") echo " checked"; ?>> รายเดือน
--------------------------------------------------------------------------------------------------------------------------------------
ขอบคุณทั้ง2ท่านอีกรอบครับผม
|
ประวัติการแก้ไข 2015-04-23 10:02:17 2015-04-23 10:28:36
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2015-04-23 09:10:45 |
By :
saovarott159 |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
|
|
|
![](/images/digitalocean-banner.jpg)
|
Load balance : Server 04
|