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可以在單引號之內被安置(』)作為解決方法或決議避免或解決錯誤。

重要: 這是現狀提供,不用保單的機器翻譯的頁。 計算機翻譯也許是難瞭解。 參見 原始的英國文章 每當可能。

分享并且貢獻或者得到技術支持并且幫助在 我的數字式生活論壇.



One Response to “WordPress MySQL SQL Query Error in WPDB Class”

  1. casey bisson
    April 16th, 2007 22:11
    1

    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/

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting


Custom Search

New Articles

Incoming Search Terms for the Article

"mysql error with query" - wordpress sql query - wpdb error - wordpress wpdb - $db->query wordpress - wordpress query database - max sql syntax - $wp_result = $wp->query($wp_query); - $wpdb - wordpress mysql class - "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 '' at line 1" - some error in query You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax - how to format sum syntax in mysql - wpdb wordpress - SQL=You have an error in your SQL syntax; check the manual that corresponds to your MySQL - wordpress wpdb order by - $wpdb->query mysql error - mysql check query error - Error: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 '=VALUE' at line 1 - query wordpress - wordpress query - i have to check is it my sql & pl/sql code right or wrong - how can i use my database query in wordpress - MySQL server version for the right syntax to use near 'LENGTH(code) DESC' at line 2 - windows 2003 you have an error in your sql syntax; check the manual - wordpress slow sql post - $wpdb errors - Mysql::Error: #42000 BLOB/TEXT column 'title' used in key specification without a key length: - MySQL server version for the right syntax to use near 'AND (post_status IN - MYSQL error SUM - SQL=You have an error in your SQL syntax; check the manual that corresponds to your MyS - wpdb->query wordpress - 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 \'ASC limit 0,1\' at line 1 - check the manual that corresponds to your MySQL server version for the right syntax to use near ') and status != 'DELETED' - How to solve WordPress database error? - mysql 5 max length on sql query - update query to change from dat to datetime mysql - wordpress database connection outside server - mysql php5 sql-query (select max - wordpress wpdb check error - 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 's ' WHERE Seriennummer - Could not retrieve article info; 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 '' at line 1 - MySQL server version for the right syntax to use near 'SET id='' WHERE id = ''' at line 1 - Script line: 4 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 '' at line 8 - wordpress database error delete post WHERE post_id - wordpress $wpdb->query update not working - error check function in sql query - how to use custom specification order by class in the mysql - how to execute sql query with wordpress - MySQL error with query -