ช่วยดูหน่อยครับ Error You have an error in your SQL syntax
มันบอกว่า
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'watch)VALUES ('266', 'ทดสà¸à¸šà¸£à¸°à¸šà¸š Embeb', 'ทดสà¸à¸šà¸£à¸' at line 1
Code (PHP)
<?
ob_start();
session_start();
if($_SESSION['UserID'] == "")
{
echo "Please Login!";
exit();
}
include '../connect.php';
$strSQL = "SELECT * FROM account WHERE UserID = '".$_SESSION['UserID']."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
?>
<?
$strSQL = "INSERT INTO upload_list (ProductID ,file ,url ,UserID ,ep ,type , ,watch)";
$strSQL .= "VALUES ('".$_POST["anime_list"]."', '".$_POST["anime_name"]."', '".$_POST["download"]."' , '".$_SESSION['UserID']."', '".$_POST["episode"]."', '".$_POST["type"]."', '".$_POST["watch"]."';";
mysql_query($strSQL) or die(mysql_error());
$objQuery = mysql_query($strSQL);
if($objQuery)
{
echo "<script>alert('Success');</script>";
echo "<script>history.back();</script>";
}
else
{
echo "Error Save [".$strSQL."]";
}
?>
Tag : PHP
Date :
2013-03-09 23:03:35
By :
nukedonut1
View :
727
Reply :
2
เว้นไว้ทำไมครับ ถ้าฟิลล์นั้นไม่เอาก็ไม่ต้องใส่ครับ
$strSQL = "INSERT INTO upload_list (ProductID ,file ,url ,UserID ,ep ,type , , watch)";
แล้วก็ เกินมาน่ะตัดออก
Code
$strSQL .= "VALUES ('".$_POST["anime_list"]."', '".$_POST["anime_name"]."', '".$_POST["download"]."' , '".$_SESSION['UserID']."', '".$_POST["episode"]."', '".$_POST["type"]."', '".$_POST["watch"]."';";
Date :
2013-03-10 19:03:57
By :
jackkichan
Load balance : Server 04