|
![](/images/resource/spacer.gif) |
|
ขอสอบถาม ผมต้องการจะทำ Ajax Selection เลือกจังหวัด,อำเภอ,ตำบล |
|
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
ผมต้องการจะทำ Ajax Selection เลือกจังหวัด,อำเภอ,ตำบล
Code (PHP)
<tr height="40">
<td align="right">จังหวัด : </td>
<td><select name="province" onchange="getAddress(this.name, 'District', 'a')" class="form-control">
<option value=""> เลือกจังหวัด </option>
<?php
include_once 'inc/config.php';
include_once 'inc/database.class.php';
$juice = new MY_SQL;
$juice->fncConnectDB();
$juice->fncSelectDB();
$juice->set_char_utf8();
$province = $juice->fncSelect("PROVINCE_ID,PROVINCE_NAME","province","ORDER BY PROVINCE_NAME ASC");
foreach($province as $read){ ?><option value="<?=$read['PROVINCE_ID']?>,<?=$read['PROVINCE_NAME']?>"><?=$read['PROVINCE_NAME']?></option><? } ?>
</select></td>
</tr>
Code (PHP)
$sql = "INSERT INTO member (fname,lname,Address,PhoneNumber,Email,Birthday,Idcard,province, District,SubDistrict,Zipcode,UserName,Password,fileupload) VALUES ('$fname','$lname','$_POST[Address]','$_POST[PhoneNumber]', '$email','$_POST[birthday]','$_POST[idcard]','$_POST[province]', '$_POST[District],'$_POST[SubDistrict],'$_POST[Zipcode]','$_POST[UserName]','$password_md5','$newname')";
ต้องการทราบว่า จะทำยังไงให้บันทึกข้อมูลแค่ ชื่อจังหวัด
เพราลองทดสอบ echo ดูแล้ว มันได้ทั้ง PROVINCE_ID, และ PROVINCE_NAME
ขอบคุณสำหรับคำตอบ
Tag : PHP
![](/images/adv.jpg?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 :
2017-04-30 17:15:13 |
By :
siamza080 |
View :
753 |
Reply :
1 |
|
![](/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) |
|
ส่วนตัวผมคิดว่า
ไม่ลองใช้ array ดูครับ
|
![](/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 :
2017-04-30 17:52:28 |
By :
maxvit |
|
![](/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 05
|