WordPress MySQL SQL Query Error in WPDB Class WordPress MySQL SQL vaicājumu Kļūda WPDB klase
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 spraudņi lietotāju vai ārējai skripti attīstītājiem var rasties problēmas, mēģinot izpildīt vaicājumu vai manipulācijām ar MySQL datu bāzi, izmantojot $ wpdb klase, klases funkciju visiem datu bāzē manipulācijas, pamatojoties uz 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 klases nodrošina vienkāršu veidu, kā piekļūt datu bāzes tabulām, bez vajadzības manuāli kods Datubāzes savienojumu sintakse in PHP vēlreiz. $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 paredz vairākas funkcijas piekļūt, iegūt, izvēlieties, dzēst, atjaunināt vai manipulēt datus datu bāzē, piemēram, jautājums, get_var, get_row, get_col, get_results, evakuācijas, show_errors, hide_errors, get_col_info, un skalojas. 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. Lietojot šos $ wpdb parsēt SQL pārskatos kā spraudņi vai ārējo skripti vai pat WordPress kods sev šādu kļūdu vai līdzīgas kļūdas var parādīties.
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 datubāzē kļūda: [Jums ir kļūda Jūsu SQL syntax; pārbaudiet rokasgrāmatā, kas atbilst Jūsu MySQL serveris versija par tiesībām sintakse izmantot pie "ORDER BY post_date ASC LIMIT 1 'at line 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 NO wp_posts KUR post_date> "un post_date <'2006-08-28 09:03:57" un post_status = 'publicēt "un ID! = ORDER BY post_date ASC LIMIT 1
or (the following from bsuite B2V6) vai (kas izriet no 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 datubāzē kļūda: [Jums ir kļūda Jūsu SQL syntax; pārbaudiet rokasgrāmatā, kas atbilst Jūsu MySQL serveris versija par tiesībām sintakse izmantot netālu 's lapas' VĒL aizgāja (b.post_title, 60) END AS nosaukumu, SUM ( a.hits_reads) AS sor 'at line 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, gadījumā, ja b.post_title IS null THEN "Alice's Home" VĒL kreisajā pusē (b.post_title, 60) END AS nosaukumu, SUM (a.hits_reads) AS sort_order, CONCAT ( "Tot:", formātā ( SUM (a.hits_reads), 0), ', Vid: ", FORMĀTS ((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: "formāts (MAX (a.hits_reads), 0),'') AS atzīmēt NO wp_bstat_hits kreisās JOIN wp_posts b ON ( a.post_id = b.ID) Ja 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. Viens no iemesliem kļūdas izraisa post_ID vai ID mainīgs, kas pārstāv ID no WordPress post. 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. Atkarībā no tā, kura versija, PHP, MySQL vai WordPress jums izmantot, $ post_id vai $ id vai $ post-> ID var novietot vienu quote ( ') kā PROFILAKSE vai rezolūcija, lai novērstu vai atrisinātu kļūdas.
IMPORTANT : The page is machine translated and provided "as is" without warranty. SVARĪGI: Šī lapa ir mašīna tulkoto un ar nosacījumu ", kas ir" bez garantijas. Machine translation may be difficult to understand. Machine translation var būt grūti saprast. Please refer to Lūdzu, skatiet original English article oriģināls angļu rakstu whenever possible. kad vien iespējams.
Related Articles Saistītie raksti
- Change or Set MySQL Long Query Time Value for log-slow-queries Maina vai Set MySQL Long Query Time Vērtība, kam log-lēni queries
- How to Customize, Modify or Change WordPress Database Connection Error Page Kā Pielāgot, grozīt vai mainīt WordPress Database Connection Error Page
- Enable Logging of Slow Queries (Slow Query Log) in MySQL Database Enable iegrāmatošana Lēna vaicājumu (Lēna Query Log) in MySQL Database
- Using PHP-MySQL Persistent Connections to Run WordPress Blog Izmantojot PHP, MySQL noturīgiem Savienojumi ar Run WordPress Blog
- MySQL Error 1170 (42000): BLOB/TEXT Column Used in Key Specification Without a Key Length MySQL Error 1170 (42000): lāse / TEXT sleja Izmantots Galvenie Specifikācija Bez Key Length
- gmmktime Error in WordPress and MagpieRSS gmmktime Kļūda WordPress un MagpieRSS
- Retrieve and Get WordPress Post ID Outside the Loop as PHP Variable Nolasītu un Get WordPress Post ID Ārpus Cikls kā PHP Mainīgais
- How to Find and Replace Text in MySQL Database using SQL Kā, lai atrastu un aizstātu tekstu MySQL datu bāzē, izmantojot SQL
- How to Backup and Restore (Export and Import) MySQL Databases Tutorial Kā Backup un Restore (Eksporta un importa) MySQL Databases Tutorial
- How to Delete Existing WordPress Post Revisions Stored/Saved Kā izdzēst esošos WordPress Post Revisions Uzglabātajos / Saglabātās










































April 16th, 2007 22:11 Aprīlis 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. I've let šīs kļūdas saglabāties pārāk ilgi, bet tagad viņi ir noteikts kopā ar ķekars citu bugs.
The latest version also lays the groundwork to transition to bsuite3, a ground-up rewrite and re-architecting of the plugin. Jaunākā versija arī nosaka pamatus, lai pāreju uz bsuite3, pieslīpēta-up pārrakstīt un atkārtoti architecting no spraudni.
http://maisonbisson.com/blog/post/11613/ http://maisonbisson.com/blog/post/11613/