【发布时间】:2011-05-22 10:54:25
【问题描述】:
这是我从 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 和几个回车符。 (除非
INSERT INTO上方的1与传递的查询无关。 -
是的,我刚刚发现了。这是我在它之前调用的另一个函数,它抛出了错误。我的错。