mysql - 烦人的 MySQL 错误

标签 mysql wordpress

这是我从 Wordpress 的 $wpdb->show_errors 获得的输出,以及查询的输出。

WordPress 数据库错误:[您的 SQL 语法有误;检查与您的 MySQL 服务器版本对应的手册,了解在第 1 行的“1”附近使用的正确语法]

1

INSERT INTO wp_posts (
to_ping, post_author, pinged, comment_count, post_password, post_excerpt, 
post_status, comment_status, ping_status, post_parent, menu_order, 
post_content_filtered, post_type, post_mime_type, post_name, post_title, 
post_content, post_date, post_date_gmt, post_modified, post_modified_gmt, guid) 
VALUES (
'', '', '', '0', '', '', 'draft', 'open', 'open', '0', '0', '', 'page', '', 
'test-page', 'This is a test!', 'This is where content goes...', 
'2010-12-08 07:38:05', '2010-12-08 07:38:05', '2010-12-08 07:38:05', 
'2010-12-08 07:38:05', 'http://localhost/wordpress/?page_id=') 

最佳答案

第一行确实有一个“1”。去掉它。单独的“1”不是有效的 MySQL 语法..

关于mysql - 烦人的 MySQL 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4391619/

相关文章:

javascript - 仅在 X 页面上运行函数

php - MySQL 查询不关心用户输入之一

html - 如何在 WordPress 中为自定义 header 实现引导小部件代码?

wordpress - 创建帖子时创建 Woocommerce 产品

php - 在 laravel 中处理模型中的关系

mysql - 加入与 mySQL 中的其他方法

MySQL计算特定条件下的行数: range from A ± 1

php - Wordpress 样式表子主题

php - 如何避免mysql中随机查询结果重复

mysql - COUNT-SQL如何识别重复项