 |
type='',lang='' ไม่มาตอนดึงมา edit ตรงไหนคับ ช่วยดูหน่อย |
|
 |
|
|
 |
 |
|
SELECT * FROM tb_product WHERE id_product='8'
UPDATE tb_product SET code='dsfdsf111',type='',lang='',title='sdfdsf111',detail='dsfsdf1111',price='dsfds1111',status='Yes',date_today='2013-03-20' WHERE id_product=8
Code (PHP)
<?
$sql="SELECT * FROM tb_product WHERE id_product='$_GET[id_product]'";
$query=mysql_query($sql) or die (mysql_error());
echo $sql;
$rec=mysql_fetch_assoc($query);
?>
<li>Language :
<select name="lang_txt" id="lang_txt" size="1">
<option>- choose -</option>
<option value="<? $rec['lang']?>"<? if($rec['lang']=='en'){?> selected <? };?>>Eng</option>
<option value="<? $rec['lang']?>"<? if($rec['lang']=='th'){?> selected <? };?>>Thai</option>
</select>
Type :
<select name="type_txt" id="type_txt" size="1">
<option selected="selected">- choose -</option>
<option value="<? $rec['type']?>"<? if($rec['type']=='MenWD'){?> selected <? };?>>Men's Wedding Dress</option>
<option value="<? $rec['type']?>"<? if($rec['type']=='WomenWD'){?> selected <? };?>>Feemale's Wedding Dress</option>
<option value="<? $rec['type']?>"<? if($rec['type']=='Acc'){?> selected <? };?>>Accessoires</option>
</select></li>
Code (PHP)
$sql_update="UPDATE tb_product SET code='$_POST[code_txt]',type='$_POST[type_txt]',lang='$_POST[lang_txt]',title='$_POST[title_txt]',detail='$_POST[detail_txt]',price='$_POST[price_txt]',status='$_POST[rdo_status]',date_today='$datetoday' WHERE id_product=$_GET[id_product]";
$query_update=mysql_query($sql_update) or die (mysql_error());
echo $sql_update;
Tag : PHP, MySQL
|
|
 |
 |
 |
 |
Date :
2013-03-18 11:18:09 |
By :
tim |
View :
767 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้ละครับ ตรง <option value="<? $rec['lang']?>"<? if($rec['lang']=='en'){?> selected <? };?>>Eng</option>
ผมลืม
<option value="<?= $rec['lang']?>"<? if($rec['lang']=='en'){?> selected <? };?>>Eng</option>
|
 |
 |
 |
 |
Date :
2013-03-18 11:23:35 |
By :
tim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|