Php UPDATE语句中的SQl语法错误
此SQL语句返回这样一个错误Php UPDATE语句中的SQl语法错误,php,sql,Php,Sql,此SQL语句返回这样一个错误 $sql_select3 = "UPDATE `pdfhash` SET `PdfHash` = '$pdf1hash',`DateModified` = '.$date.' WHERE `Filename` ='current.pdf'"; 不正确的引用使用方式 Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
$sql_select3 = "UPDATE `pdfhash`
SET `PdfHash` = '$pdf1hash',`DateModified` = '.$date.'
WHERE `Filename` ='current.pdf'";
不正确的引用使用方式
Error: 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 'current.pdf'',`DateModified` = 'Thursday the 30th ' WHERE `Filename` ='.current.' at line 1
替换
$sql_select3 = "UPDATE `pdfhash` SET `PdfHash` = '$pdf1hash',
`DateModified` = " . $date ."
WHERE `Filename` ='current.pdf'";
与
试试这个
'".$date."'
这将有所帮助。$sql\u select3=“更新pdfhash
SETpdfhash
='pdf1hash',DateModified
='”“$date.”其中Filename
='current.pdf'
“.$date.”至
'“$date.”显示没有php变量的精确查询设置此错误:您的SQL语法有错误;请查看与MySQL服务器版本对应的手册,以了解在第1行“current.pdf”“DateModified=30号星期四”附近使用的正确语法,
DateModified='$date'
不使用dotsError:您的SQL语法有错误;查看与MySQL服务器版本对应的手册,以了解在“current.pdf”附近使用的正确语法,DateModified
=“30日星期四”第1行您需要转义“current.pdf”,因为他看不懂点当前\.pdf'
'".$date."'
$sql_select3 = "UPDATE `pdfhash` SET `PdfHash` = '".$pdf1hash."',`DateModified` = '".$date."' WHERE `Filename` ='current.pdf'";