错误1064 - MySQL

时间:2012-10-04 22:25:31

标签: php mysql

出于某种原因,我收到了以下MySQL错误,但我似乎无法将手指放在我出错的地方。请问您能告诉我错误的位置以及我如何解决它?

  

1064 - 您的SQL语法出错;检查与MySQL服务器版本对应的手册,以获得正确的语法

     

near'“4ed2a19702d5feaa1eea283f”,'必胜客','比萨店',   第1行的51.604771458125,-0.1884'

查询:

INSERT INTO `venues` (`fq_id`, `title`, `category`, `latitude`, `longitude`, `location`) ('4ed2a19702d5feaa1eea283f', 'Pizza Hut', 'Pizza Place', 51.604771458125, -0.18844127655029, '{\"address\":\"128 Ballards Lane\",\"lat\":51.604771458125,\"lng\":-0.18844127655029,\"postalCode\":\"N3 2PA\",\"city\":\"London\",\"country\":\"United Kingdom\",\"cc\":\"GB\",\"distance\":0}')

表格结构:

CREATE TABLE `venues` (
  `fq_id` varchar(255) NOT NULL,
  `title` varchar(255) NOT NULL,
  `location` text NOT NULL,
  `category` varchar(50) NOT NULL,
  `latitude` float(10,6) NOT NULL,
  `longitude` float(10,6) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`fq_id`),
  KEY `category` (`category`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

1 个答案:

答案 0 :(得分:4)

您错过了VALUES关键字:

INSERT INTO `venues` (`fq_id`, `title`, `category`, `latitude`, `longitude`, `location`)
VALUES
(...)