-5
$sql_select3 = "UPDATE `pdfhash` 
SET `PdfHash` = '$pdf1hash',`DateModified` = '.$date.' 
WHERE `Filename` ='current.pdf'";

此 SQL 语句返回一个错误,说明这一点

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
4

4 回答 4

4

像这样不正确的引用使用,

$sql_select3 = "UPDATE `pdfhash` SET `PdfHash` = '$pdf1hash',
               `DateModified` = " . $date ." 
                WHERE `Filename` ='current.pdf'";
于 2013-05-30T09:11:06.460 回答
1

尝试这个

$sql_select3 = "UPDATE `pdfhash` SET `PdfHash` = '".$pdf1hash."',`DateModified` = '".$date."' WHERE `Filename` ='current.pdf'";

这会有所帮助。

于 2013-05-30T09:12:55.420 回答
0

代替

'.$date.'

'".$date."'
于 2013-05-30T09:12:01.650 回答
0

$sql_select3 = "UPDATE pdfhashSET PdfHash= '$pdf1hash', DateModified= '".$date."' WHERE Filename='current.pdf'";

'.$日期。' 至

'".$date."'

于 2013-05-30T10:12:41.060 回答