gpt4 book ai didi

mysql - PDO 语法错误,SQLSTATE[42000]

转载 作者:太空宇宙 更新时间:2023-11-03 12:34:48 26 4
gpt4 key购买 nike

<分区>

我收到以下错误,但我看不到问题所在。感谢您的帮助。

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 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 'unique) VALUES ('XX.XXX.XX.X','03/12/2012','XX.XXX.XX.X - 03/12/2012')' at line 1' in /home/content/07/XXX/html/header.php:11 Stack trace: #0 /home/content/07/XXX/html/header.php(11): PDOStatement->execute(Array) #1 /home/content/07/XXX/html/index.php(15): include('/home/content/0...') #2 {main} thrown in /home/content/07/XXX/html/header.php on line 11

$ip = $_SERVER['REMOTE_ADDR'];
$date = date("d/m/Y");
$unique = $ip." - ".$date;

$data = array($ip, $date, $unique, $date);
$STH1 = $DBH->prepare("INSERT INTO uniques (ip, date, unique) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE date = ?");
$STH1->execute($data);

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com