WordPress MySQL SQL询问错误在WPDB类
WordPress插入用户或外部剧本开发商在MySQL数据库时也许遇到问题在,当设法通过使用$wpdb类进行询问或操作,作用类为根据ezSQL的所有数据库操作。 $wpdb Wordpress类在PHP提供容易的方法访问对数据库表,不用需要再手工编码数据库连接句法。 $wpdb在数据库提供几个作用给通入,检索,选择,删除,更新或者操作数据例如询问, get_var, get_row、get_col、get_results、逃命、show_errors、hide_errors, get_col_info和充足。 当使用这$wpdb解析SQL声明和在插入或外部剧本甚至Wordpress代码时以下错误或相似的错误也许出现。
WordPress数据库错误: [您有一个错误在您的SQL句法; 检查对应于您的MySQL服务器版本为正确的句法于近用途‘由post_date ASC极限1预定’在线1]的指南
选择ID、post_title从wp_posts, post_date >”并且post_date <'2006-08-28 09:03:57' AND post_status='publish' AND ID !="ORDER" BY post_date ASC LIMIT 1
或(以下从bsuite B2V6)
WordPress数据库错误: [您有一个错误在您的SQL句法; 检查对应于您的MySQL服务器版本为正确的句法于近用途’ s呼叫’左的指南(b.post_title, 60)末端作为标题,总和(a.hits_reads)作为sor’在线4]
选择a.post_id作为post_id,案件,当b.post_title是空然后`阿丽斯的家庭’左(b.post_title, 60)时末端作为标题,总和(a.hits_reads)作为sort_order, CONCAT (’小孩: `格式(总和(a.hits_reads), 0), `Avg : `格式((总和(a.hits_reads)) /((TO_DAYS (现在())
- TO_DAYS (分钟(a.bstat_date))) + 1), 0), `最大: `、格式(MAX (a.hits_reads), 0), `’)作为笔记从wp_bstat_hits左边由a.post_id命令加入wp_posts b在(a.post_id = b.ID) bstat_date > `2006-08-03 ′小组由sort_order DESC极限5的地方
一错误的原因是由代表Wordpress岗位的ID的post_ID或ID可变物造成的。 根据PHP的哪个版本、MySQL或者WordPress您使用了, $post_id或$id或者$post->ID可以在单引号之内被安置(’)作为解决方法或决议避免或解决错误。
重要: 这是现状提供,不用保单的机器翻译的页。 计算机翻译也许是难了解。 参见 原始的英国文章 每当可能。
分享并且贡献或者得到技术支持并且帮助在 我的数字式生活论坛.
相关文章
- 改变或设置长的询问时间值为日志慢询问的MySQL
- Enable Logging of Slow Queries (Slow Query Log) in MySQL Database
- How to Move WordPress Blog to New Domain or Location
- You Are Not Authorized to Execute SQL Queries in vBulletin Maintenance
- How to Customize, Modify or Change WordPress Database Connection Error Page
- Oracle PL/SQL ORA-00947 Not Enough Values Error
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 4
- How to Delete Existing WordPress Post Revisions Stored/Saved
- ORA-01502 Oracle Index in Unusable State
- MySQL Error 1170 (42000): BLOB/TEXT Column Used in Key Specification Without a Key Length




























April 16th, 2007 22:11
I’ve let these errors persist for way too long, but now they’re fixed along with a bunch of other bugs.
The latest version also lays the groundwork to transition to bsuite3, a ground-up rewrite and re-architecting of the plugin.
http://maisonbisson.com/blog/post/11613/