WordPress MySQL SQL Query Error in WPDB Class WordPress MySQL SQL Query Помилка в WPDB класу
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 плагіни користувачів або зовнішніх скриптів розробники можуть зіткнутися з проблемами, коли намагаюся виконати запит або маніпуляції на MySQL базу даних за допомогою $ wpdb клас, клас функцій, для всіх баз даних маніпуляції засновані на 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 класу забезпечує простий спосіб доступу до таблиць бази даних, без необхідності вручну коду в базі даних у зв'язку синтаксис PHP знову. $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 передбачає ряд функцій для доступу, пошуку, вибору, вилучення, оновлення або маніпулювати даними в базі даних, таких як запит, get_var, get_row, get_col, get_results, бігти, show_errors, hide_errors, get_col_info і промийте. 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. При використанні цих $ wpdb розібрати SQL заяви до модулів або зовнішні скрипти або навіть Wordpress код собі наступну помилку або аналогічні помилки можуть з'явитися.
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: [У вас є помилка у Вашому SQL синтаксису; перевірити вручну, що відповідає вашим MySQL сервером версії за право на використання синтаксису біля 'ORDER BY post_date ASC LIMIT 1 "на лінії 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 SELECT ID, post_title З wp_posts ДЕ post_date> "і post_date <'2006-08-28 09:03:57 'І post_status =' опублікувати 'і ид! = ORDER BY post_date ASC LIMIT 1
or (the following from bsuite B2V6) або (наступне з 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: [У вас є помилка у Вашому SQL синтаксису; перевірити вручну, що відповідає вашим MySQL сервером версії за право на використання синтаксису поблизу 'S сторінок' ELSE LEFT (b.post_title, 60) END, як назва, SUM ( a.hits_reads) AS Сор "у рядку 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()) SELECT a.post_id AS post_id, коли b.post_title IS NULL THEN 'Аліса's Home' ELSE LEFT (b.post_title, 60) END, як назва, SUM (a.hits_reads) С. sort_order, CONCAT ( 'Всього:', FORMAT ( SUM (a.hits_reads), 0), ', Ср:', FORMAT ((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), 'Макс:', FORMAT (MAX (a.hits_reads), 0 ),'') AS Повідомлення від wp_bstat_hits лівій ПРИСОЕДИНЯЙСЯ wp_posts B ON ( a.post_id = b.ID), де bstat_date>'2006-08-03 'GROUP BY a.post_id ORDER BY sort_order DESC LIMIT 5
One of the reason for the errors is caused by post_ID or ID variable that represent the ID of the Wordpress post. Одна з причин помилок, викликаних post_ID або ідентифікатор змінної, яка представляє ID в Wordpress пост. 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. В залежності від версії PHP, MySQL або WordPress ви використовували в $ post_id або $ ID або $ поста-> ID може бути поміщений усередині одинарна лапках ( ') в якості обходу або резолюції, з тим щоб запобігти або вирішити цю помилку.
IMPORTANT : The page is machine translated and provided "as is" without warranty. Увага: Ця сторінка машина переведена і надаються "як є" без гарантії. Machine translation may be difficult to understand. Машинний переклад може бути важким для розуміння. Please refer to Будь ласка, зверніться до original English article Англійська оригінальні статті whenever possible. коли це можливо.
Related Articles Статті по темі
- Change or Set MySQL Long Query Time Value for log-slow-queries Змінити або Установка MySQL Довгий Запит Час Вартість входу повільно запити
- How to Customize, Modify or Change WordPress Database Connection Error Page Як налаштовувати, модифікувати або змінювати WordPress з'єднання Помилка сторінку
- Enable Logging of Slow Queries (Slow Query Log) in MySQL Database Включити логгінг повільних запитів (Низька Запит реєстрації) в бази даних MySQL
- Using PHP-MySQL Persistent Connections to Run WordPress Blog Використання PHP-MySQL постійні з'єднання для запуску блог WordPress
- MySQL Error 1170 (42000): BLOB/TEXT Column Used in Key Specification Without a Key Length MySQL Помилка 1170 (42000): BLOB / TEXT колонці Використовується в Ключові характеристики Без довжину ключа
- gmmktime Error in WordPress and MagpieRSS gmmktime Помилка в WordPress та MagpieRSS
- Retrieve and Get WordPress Post ID Outside the Loop as PHP Variable Отримати і отримати WordPress пост ID Поза Loop як PHP Змінні
- How to Find and Replace Text in MySQL Database using SQL Як знайти і замінити текст в бази даних MySQL, використовуючи SQL
- How to Backup and Restore (Export and Import) MySQL Databases Tutorial Як резервне копіювання і відновлення (експорт та імпорт) баз даних MySQL Учебник
- How to Delete Existing WordPress Post Revisions Stored/Saved Як видалити існуючі WordPress пост Перегляд Збереження / Збереження










































April 16th, 2007 22:11 16 квітня 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. В останній версії також закладає основи для переходу до bsuite3, підставою діяльності переписати і знову architecting з плагіна.
http://maisonbisson.com/blog/post/11613/ http://maisonbisson.com/blog/post/11613/