|
|
|
ช่วยด้วยคราฟ Parse error: syntax error, unexpected T_STRING in C:\AppServ\www\nes1\Admin\upload.php on line 51 |
|
|
|
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>Untitled Document</title>
</head>
<body>
<?
include("connect.php");
$sql = "Insert into product(id_prd,name_prd,prd_type,detail_prd,price_prd) values ('$id_prd','$name_prd','$prd_type','$detail_prd','$price_prd')";
mysql_query("SET NAMES UTF8");
$result=mysql_query($sql);
if ($result)
{
echo"บันทึกข้อมูลเรียบร้อย";
//echo "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=index.php\">";
//mysql_close($link);
}
else
{
// echo $id_prd;
// echo $name_prd;
// echo $prd_type;
// echo $detail_prd;
//echo $price_prd;
//echo $photo_prd;
echo"ไม่สามารถบันทึกข้อมูลได";
mysql_close();
}
$host="localhost";
$username="root";
$pass_word="1234";
$db="nes";
mysql_connect( $host,$username,$pass_word) or die ("ติ ดต? อกั บฐานข? อมู ล Mysql ไม? ได? ");
mysql_select_db($db) or die("เลื อกฐานข?อมู ลไม? ได? ");
$filename =$HTTP_POST_FILES['files']['name'];
$filetempname =$HTTP_POST_FILES['files']['tmp_name'];
$filesize =$HTTP_POST_FILES['files']['size'];
$fp = fopen($filetempname,"r");
$data = fread($fp,filesize($filetempname));6
fclose($fp);
$data = addslashes($data);
$sql="insert into product(photo_prd) values ('$data')";
$db_query=mysql_db_query($db,$sql);
mysql_close();
?>
</body>
</html>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2011-09-02 19:30:26 |
By :
Nate_ |
View :
797 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
มันบอกว่าผิดตรงนี้คับ
fclose($fp);
ช่วยด้วยนะคับ
|
|
|
|
|
Date :
2011-09-02 19:32:22 |
By :
Nate_ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$data = fread($fp,filesize($filetempname));6
|
|
|
|
|
Date :
2011-09-02 21:45:33 |
By :
ikikkok |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|