|
|
|
อยากอัพรูปไปยังดาต้าเบส โดยสร้างฟอร์มอัพเดทแล้วส่งค่าหน้าโค้ดไปหน้า update_pro |
|
|
|
|
|
|
|
ส่งไปยังหน้า send
Code
<?
include("connect.php");
$type_id=$_POST[type_id];
$pro_id=$_POST[pro_id];
$pro_name1=$_POST[pro_name1];
$pro_name=$_POST[pro_name];
$pro_property=$_POST[pro_property];
$pro_date=$_POST[pro_date];
//$image = $_POST["filUpload"];
$strSQL = "UPDATE product ";
$strSQL .=" SET image = '".$_POST["filUpload"]."' WHERE pro_id='$pro_id' ";
$ok = mysql_query($strSQL) or die ("errer");
if(move_uploaded_file($_FILES['filUpload']["tmp_name"],"picproduct/".$_FILES['filUpload']["name"]))
{
//*** Delete Old File ***//
//@unlink("picproduct/".$_POST["hdnOldFile"]);
//*** Update New File ***//
$sql="update product set type_id='$type_id',pro_name1='$pro_name1',pro_name='$pro_name',
pro_property='$pro_property',pro_date='$pro_date', unit1'$unit1',price_cost1='$price_cost1',price1='$price1', unit2='$unit2',price_cost2='$price_cost2',price='$price2','".$_FILES["filUpload"]["name"]."' where pro_id='$pro_id'";
$ok=mysql_query($sql) or die ("ไม่สามารถแก้ไขข้อมูลได้");
}
if($ok)
?>
<script language="Javascript">
alert ("อัพเดทเรียบร้อยแล้วค่ะ");
window.location='Resualt_Product.php';
</script>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2013-01-29 09:32:42 |
By :
Yuii |
View :
706 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|