|
 |
|
รบกวนอีกที...เกี่ยวกับ combobox code combobox...ดึงข้อมูลจากMySqlมาแสดง |
|
 |
|
|
 |
 |
|
<select name="Faculty" id="Faculty"onChange="location.href='register.php?ID_Fac='+this.value;" style="width:200px">
<option value="">- กรุณาเลือกคณะ -</option>
<?
$host="localhost";
$user="root";
$password="123456";
$dbname="vehicles";
$connection=mysql_connect($host,$user,$password) or die("เชื่อมต่อฐานข้อมูลไม่ได้");
mysql_select_db($dbname) or die("ไม่สามารถเลือกฐานข้อมูลได้");
$cs1 = "SET character_set_results=tis620";
mysql_query($cs1) or die('Error query: ' . mysql_error());
$cs2 = "SET character_set_client = tis620";
mysql_query($cs2) or die('Error query: ' . mysql_error());
$cs3 = "SET character_set_connection = tis620";
mysql_query($cs3) or die('Error query: ' . mysql_error());
$sql="select * from faculty order by ID_Fac ASC";
$dbquery=mysql_db_query($dbname,$sql);
while($result=mysql_fetch_array($dbquery)){
if($ID_Fac == $result[ID_Fac]){
?>
<option value="<?=$result[ID_Fac];?>" selected="selected"><?=$result[Nm_Fac];?></option>
<?
}else{?>
<option value="<?=$result[ID_Fac];?>"><?=$result[Nm_Fac];?></option>
<?
} }
?>
</select>
ตอนนี้แสดงแล้วค่ะ...แต่ทำไม่เพจrefreshหน้าตัวเองเวลาเลือกคะ...ทามให้ตรอกกรอกข้อมูลใหม่หมด
|
 |
 |
 |
 |
Date :
2009-08-20 20:57:54 |
By :
dektatee |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
.ใช้ได้แว้วคร่า ขอบคุนคร่า
|
 |
 |
 |
 |
Date :
2009-08-21 07:12:28 |
By :
dektatee |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|