我有这个脚本:
include ('connect.php');
$data = mysql_query("SELECT * FROM projects WHERE id='2'") ;
$da = mysql_fetch_array($data);
if(isset($_POST['submit'])){
$name = $_POST['project_name'];
$date = $_POST['date'];
$amount = $_POST['amount'];
$curr = $_POST['curr'];
$spec = $_POST['spec'];
$sql = "UPDATE projects
SET (name='$name', date='$date', amount='$amount', currency='$curr', specifications='$spec')
WHERE id=2";
$res = mysql_query($sql);
if($res)
{
echo "Upadate Successfull!";
}
else
{
echo "Sorry!";
echo mysql_error($connect)."<br />";
echo error_reporting(E_ALL)."<br />";
echo ini_set('desplay_errors','1');
}
注意:connect.php 文件工作正常,因为我之前在其他脚本上使用过它,但在同一台服务器上。
每次我尝试提交表单时:
Sorry!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 '(name='sdadas', date='08/21/2013', amount='2444', currency='dollars', specificat' at line 2
32767
可能是什么问题呢?