WordPress MySQL SQL Query Error in WPDB Class WordPress MySQL Lỗi truy vấn SQL trong WPDB Class
WordPress plug-ins users or external scripts developers may encounter problems on when trying to perform query or manipulation on MySQL database by using $wpdb class, a class of functions for all database manipulations based on the ezSQL. WordPress plug-in script người sử dụng hoặc bên ngoài nhà phát triển có thể gặp vấn đề khi cố gắng thực hiện truy vấn hoặc Thao tác trên cơ sở dữ liệu MySQL bằng cách sử dụng $ wpdb lớp học, một lớp học của các chức năng cho tất cả các cơ sở dữ liệu manipulations, dựa vào các ezSQL. $wpdb Wordpress class provides easy way to access to database tables without the need to manually code the database connection syntax in PHP again. $ wpdb Wordpress cung cấp các lớp học cách dễ dàng để truy cập vào bảng cơ sở dữ liệu mà không cần phải tự tay kết nối cơ sở dữ liệu mã số cú pháp trong PHP lại. $wpdb provides several functions to access, retrieve, select, delete, update or manipulate the data in the database such as query, get_var, get_row, get_col, get_results, escape, show_errors, hide_errors, get_col_info, and flush. $ wpdb cung cấp một số chức năng để truy cập, tải về, chọn, xóa, hoặc các thao tác cập nhật dữ liệu trong cơ sở dữ liệu như truy vấn, get_var, get_row, get_col, get_results, thoát, show_errors, hide_errors, get_col_info, và tuôn ra. When using these $wpdb to parse SQL statements as in plug-ins or external scripts or even Wordpress code itself the following error or similar error may appear. Khi sử dụng những $ wpdb phân tích cú pháp SQL kê như trong plug-in script hoặc bên ngoài hoặc thậm chí tự Wordpress mã các lỗi sau hoặc tương tự như báo lỗi có thể xuất hiện.
WordPress database 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 'ORDER BY post_date ASC LIMIT 1' at line 1] WordPress lỗi cơ sở dữ liệu: [Bạn có một lỗi SQL của bạn trong cú pháp, kiểm tra sổ tay của bạn có tương ứng với máy chủ MySQL phiên bản cho đúng cú pháp để sử dụng gần 'ĐẶT HÀNG THEO post_date ASC giới hạn 1' tại dòng 1]
SELECT ID, post_title FROM wp_posts WHERE post_date > ” AND post_date < '2006-08-28 09:03:57' AND post_status = 'publish' AND ID != ORDER BY post_date ASC LIMIT 1 CHỌN ID, post_title TỪ wp_posts Tìm post_date> "và post_date <'2006-08-28 09:03:57 'VÀ post_status =' xuất bản 'và ID! = ĐẶT HÀNG THEO post_date ASC giới hạn 1
or (the following from bsuite B2V6) hoặc (sau đây từ bsuite B2V6)
WordPress database 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 pages' ELSE LEFT(b.post_title, 60) END AS title, SUM(a.hits_reads) AS sor' at line 4] WordPress lỗi cơ sở dữ liệu: [Bạn có một lỗi SQL của bạn trong cú pháp, kiểm tra sổ tay của bạn có tương ứng với máy chủ MySQL phiên bản cho đúng cú pháp để sử dụng ở gần các trang 'Else còn lại (b.post_title, 60) END như tiêu đề, SUM ( a.hits_reads) AS sor 'ở dòng 4]
SELECT a.post_id AS post_id, CASE WHEN b.post_title IS NULL THEN 'Alice's Home' ELSE LEFT(b.post_title, 60) END AS title, SUM(a.hits_reads) AS sort_order, CONCAT('Tot: ', FORMAT(SUM(a.hits_reads), 0), ', Avg: ', FORMAT((SUM(a.hits_reads)) / ((TO_DAYS(NOW()) CHỌN a.post_id AS post_id, CASE KHI b.post_title LAØ Null THEN 'Alice của Trang chủ "khác còn lại (b.post_title, 60) END như tiêu đề, SUM (a.hits_reads) AS sort_order, CONCAT (' Tot: ', định dạng ( SUM (a.hits_reads), 0), ', bình quân:', định dạng ((SUM (a.hits_reads)) / ((TO_DAYS (NOW ())
- TO_DAYS(MIN(a.bstat_date))) + 1), 0), ', Max: ', FORMAT(MAX(a.hits_reads), 0), '') AS note FROM wp_bstat_hits a LEFT JOIN wp_posts b ON (a.post_id = b.ID) WHERE bstat_date > '2006-08-03′ GROUP BY a.post_id ORDER BY sort_order DESC LIMIT 5 - TO_DAYS (MIN (a.bstat_date))) + 1), 0), ', Max:', định dạng (Max (a.hits_reads), 0),'') AS wp_bstat_hits TỪ lưu ý còn lại một công wp_posts b ON ( a.post_id = b.ID) Tìm bstat_date>'2006-08-03 'GROUP THEO a.post_id ĐẶT HÀNG THEO sort_order Desc giới hạn 5
One of the reason for the errors is caused by post_ID or ID variable that represent the ID of the Wordpress post. Một trong những lý do cho các sai sót là do post_ID hoặc ID biến đại diện các ID của các Wordpress đăng bai. Depending on which version of PHP, MySQL or WordPress you used, the $post_id or $id or $post->ID can be placed within single quote (') as the workaround or resolution to avoid or solve the error. Tùy thuộc vào phiên bản PHP, MySQL WordPress hoặc bạn đã sử dụng, các post_id hoặc $ $ $ id hoặc đăng bài-> ID có thể được đặt trong một báo giá ( ') như là workaround hoặc giải quyết để tránh hoặc giải quyết lỗi.
IMPORTANT : The page is machine translated and provided "as is" without warranty. Lưu ý: Các trang web là máy tính dịch và cung cấp "như là" mà không có bảo hành. Machine translation may be difficult to understand. Máy dịch thuật có thể là khó hiểu. Please refer to Xin vui lòng tham khảo original English article Tiếng Anh bản gốc bài viết whenever possible. bất cứ khi nào có thể.
Related Articles Bài viết liên quan
- Change or Set MySQL Long Query Time Value for log-slow-queries Thay đổi hoặc Đặt MySQL Long Truy vấn Thời gian giá trị gia tăng cho log-slow-queries
- How to Customize, Modify or Change WordPress Database Connection Error Page Làm thế nào để Customize, Chỉnh sửa hoặc thay đổi WordPress Trang Lỗi kết nối cơ sở dữ liệu
- Enable Logging of Slow Queries (Slow Query Log) in MySQL Database Kích hoạt Đăng của Slow Queries (Slow Query Log) trong cơ sở dữ liệu MySQL
- Using PHP-MySQL Persistent Connections to Run WordPress Blog Sử dụng PHP-MySQL Persistent kêt nôi đên Chạy WordPress Blog
- MySQL Error 1170 (42000): BLOB/TEXT Column Used in Key Specification Without a Key Length MySQL Lỗi 1170 (42000): BLOB / TEXT Cột khóa Đặc điểm kỹ thuật được sử dụng trong Nếu không có một khóa Length
- gmmktime Error in WordPress and MagpieRSS gmmktime Lỗi trong WordPress và MagpieRSS
- Retrieve and Get WordPress Post ID Outside the Loop as PHP Variable Hãy nhận lấy và WordPress Đăng ID Bên ngoài Vòng như PHP Variable
- How to Find and Replace Text in MySQL Database using SQL Làm thế nào để Tìm và Thay thế văn bản trong cơ sở dữ liệu MySQL bằng cách sử dụng SQL
- How to Backup and Restore (Export and Import) MySQL Databases Tutorial Làm thế nào để sao lưu và Phục hồi (hàng xuất khẩu và nhập khẩu) Hướng dẫn Cơ sở dữ liệu MySQL
- How to Delete Existing WordPress Post Revisions Stored/Saved Xoá Làm thế nào để mọi WordPress Revisions Đăng Lưu trữ / Đã lưu










































April 16th, 2007 22:11 16 tháng tư, 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. Tôi đã cho phép các lỗi này cho kiên gan cách quá dài, nhưng bây giờ họ đang cố định cùng với một lỗi khác của bunch.
The latest version also lays the groundwork to transition to bsuite3, a ground-up rewrite and re-architecting of the plugin. Các phiên bản mới nhất cũng lays the groundwork để chuyển đổi sang bsuite3, một đất lên và ghi đè lại architecting của các plugin.
http://maisonbisson.com/blog/post/11613/ http://maisonbisson.com/blog/post/11613/