 |
|
ผมต้องการให้นำข้อมูล ช่องที่เรา update table tsportman ไป insert ใน table titem โดยที่เอาเฉพาะข้อมูลที่เราสั่ง update เท่านั้นไป insert
รบกวนด้วยครับพี่ๆ
<?php
include("connect.php");
$tsmid=$_POST["tsmid"];
$tnumber=$_POST["tnumber"];
$tdiscription=$_POST["tdiscription"];
$tmonitor=$_POST["tmonitor"];
$tharddisk=$_POST["tharddisk"];
$tmemory=$_POST["tmemory"];
$tdrive=$_POST["tdrive"];
$tkeyboard=$_POST["tkeyboard"];
$tmouse=$_POST["tmouse"];
$tcpu=$_POST["tcpu"];
$sql = "insert into titem (tname,tstatus,smid)
values ('$tnumber','Changed','$tsmid')";
mysql_query($sql);
}
$sql = "UPDATE tsportman SET number='$tnumber',dct='$tdiscription',monitor='$tmonitor',harddisk='$tharddisk'
,memory='$tmemory',drive='$tdrive',keyboard='$tkeyboard',mouse='$tmouse',cpu='$tcpu' WHERE smid=$tsmid";
mysql_query($sql);
//echo "<meta http-equiv='refresh' content='0; url=home.php'>";
?>
Tag : PHP, MySQL
|
|
 |
 |
 |
 |
Date :
2011-03-18 13:17:26 |
By :
blackmamba |
View :
867 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |