|
 |
|
ครั้งแรกที่ทำ ขอถามหน่อยคับ จะรู้ได้ไงว่ารุ่นรถที่เราเลือกหมดอายุแล้ว |
|
 |
|
|
 |
 |
|
คุณช่วยบอกหย่อยจิครับว่า ถ้าหมดอายุแล้วให้เป็นยังไง
ที่คุณเขียนมาก็ O แล้วครับ ถูกทางแล้ว
|
 |
 |
 |
 |
Date :
2009-06-08 15:56:48 |
By :
nongjen |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้าต้องการแค่แสดงใน listbox ด้วยใช่ป่าวครับ
<form id="form1" name="form1" method="post" action="">
<label>
<select name="select">
<?
$sql2 ="select type_id ,type_name ,timeout from brand Order By brand.type_id DESC ";
$retime=mysql_query($sql2);
while($rstime = mysql_fetch_array( $retime )){
?> <option value="<?=$rstime[type_id]?>"><?=$rstime[type_name]?> <?=$rstime[timeout]?></option>
<? }?>
</select>
</label>
</form>
|
 |
 |
 |
 |
Date :
2009-06-08 16:02:17 |
By :
nongjen |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้ามันหมดอายุแล้วผมก้อให้เขากลับไปเลือกข้อมูลใหม่นะคับ
echo "<script>alert('yes ');href='submit.php';history.go (-1);</script>";
|
 |
 |
 |
 |
Date :
2009-06-08 16:02:33 |
By :
thing |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
งั้นเอางี้มั้ยครับตอน Qoery มาใส่ใน Listbox ให้เชคเลยว่าหมดอายังถ้าหมดแล้วก็ไม่ต้องให้มันโชว์เลือกให้เสียเวลาน่ะครับ ง่ายกว่าด้วย
|
 |
 |
 |
 |
Date :
2009-06-08 16:19:08 |
By :
nongjen |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้าเช็คแบบนั้นแล้วเขียนยากมั้ยคับ เกรินๆให้ผมหน่อยได้มั้ยคับ
|
 |
 |
 |
 |
Date :
2009-06-08 16:27:53 |
By :
thing |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เพิ่ม if ไปแค่นี้แหละ
<form id="form1" name="form1" method="post" action="">
<label>
<select name="select">
<?
$sql2 ="select type_id ,type_name ,timeout from brand Order By brand.type_id DESC ";
$retime=mysql_query($sql2);
while($rstime = mysql_fetch_array( $retime )){
if($rstime[timeout]!=หมดอายุ){
?> <option value="<?=$rstime[type_id]?>"><?=$rstime[type_name]?> <?=$rstime[timeout]?></option>
<?} }?>
</select>
</label>
</form
|
 |
 |
 |
 |
Date :
2009-06-08 19:43:06 |
By :
nongjen |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากนะคับคุณ nongjen
|
 |
 |
 |
 |
Date :
2009-06-09 10:56:59 |
By :
thing |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|