|
|
|
ช่วยดูโค้ดให้ด้วยคะ จะทำuploadไฟล์ ยังไม่ลงฐานข้อมูลเลยคะ |
|
|
|
|
|
|
|
<?php
session_start();
include("config.inc.php");
$date = date("Y-m-d H:i:s");
copy($_FILES["userfile"]["tmp_name"][$i],"fileupload/".$_FILES["userfile"]["name"]);
$strSQL = "INSERT INTO discussion (TitleName,Recipient,Detail,Createby,Modified,FilesName)
VALUES
('".$_POST[txtTitle]."','".$_POST[txtRecipient]."','".$_POST[txtDetail]."','".$_SESSION['Username']."','$date','".$_FILES["userfile"]["name"]."')";
$objQuery = mysql_query($strSQL);
if($objQuery){
echo "บันทุกสำเร็จ";
echo "<meta http-equiv='refresh' content='1 ;url=receiveItem.php'>" ;
}
else{
echo "Error Save [".$strSQL."]";
}
mysql_close();
?>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2011-05-20 15:16:56 |
By :
chokul |
View :
692 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|