Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is encountering a WordPress database error related to SQL syntax while using WPML.
Solution:
1. We asked the client to inform us where they are encountering the error.
2. We suggested clearing the debug log to check if the issue persists.
3. We recommended performing a test with only WPML plugins enabled to isolate the issue.
4. We emphasized the importance of taking a database backup before making any changes.

Please note that the solution provided might be outdated or not applicable to your case. If after trying the suggested steps the issue persists, we encourage you to open a new support ticket with us. We also highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please contact us through the WPML support forum.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Andrey 1 year, 2 months ago.

Assisted by: Andrey.

Author Posts
February 6, 2024 at 12:54 pm #15271891

francescoA-33

Thank you for your reply, and about this error in the wp-debug:

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 ')
AND translations.source_language_code IS NOT NULL
AND ( posts.post_sta' at line 16 for query
SELECT jobs.rid, jobs.job_id as jobId, jobs.editor_job_id as ateJobId, jobs.automatic , translation_status.status,
translation_status.review_status, jobs.ate_sync_count > 100 as isLongstanding
FROM jhbwp_icl_translate_job as jobs
INNER JOIN jhbwp_icl_translation_status translation_status ON translation_status.rid = jobs.rid
INNER JOIN jhbwp_icl_translations translations ON translation_status.translation_id = translations.translation_id
INNER JOIN jhbwp_icl_translations parent_translations ON translations.trid = parent_translations.trid
AND parent_translations.source_language_code IS NULL
LEFT JOIN jhbwp_posts posts ON parent_translations.element_id = posts.ID
WHERE
jobs.job_id IN (
SELECT MAX(job_id) FROM jhbwp_icl_translate_job
GROUP BY rid
)
AND jobs.editor = 'ate'
AND ( translation_status.status IN (1,2,40) OR 1=0 )
AND translations.language_code IN ()
AND translations.source_language_code IS NOT NULL
AND ( posts.post_status IS NULL OR posts.post_status <> 'trash' )
made by require_once('wp-admin/admin.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('wp_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, WPMLLIBWPHooks::WPMLLIBWP{closure}, WPMLFPPromise->resolve, WPMLFPRight->chain, WPMLFPRight->map, WPMLTMATELoader::getData, WPMLTMATEJobs::getJobsToSync, WPMLTMATEJobs::getJobsWithStatus
[06-Feb-2024 08:14:36 UTC] 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 ')
AND translations.source_language_code IS NOT NULL
AND ( posts.post_sta' at line 16 for query
SELECT jobs.rid, jobs.job_id as jobId, jobs.editor_job_id as ateJobId, jobs.automatic , translation_status.status,
translation_status.review_status, jobs.ate_sync_count > 100 as isLongstanding
FROM jhbwp_icl_translate_job as jobs
INNER JOIN jhbwp_icl_translation_status translation_status ON translation_status.rid = jobs.rid
INNER JOIN jhbwp_icl_translations translations ON translation_status.translation_id = translations.translation_id
INNER JOIN jhbwp_icl_translations parent_translations ON translations.trid = parent_translations.trid
AND parent_translations.source_language_code IS NULL
LEFT JOIN jhbwp_posts posts ON parent_translations.element_id = posts.ID
WHERE
jobs.job_id IN (
SELECT MAX(job_id) FROM jhbwp_icl_translate_job
GROUP BY rid
)
AND jobs.editor = 'ate'
AND ( translation_status.status IN (30) OR translation_status.review_status IN ( 'NEEDS_REVIEW','EDITING' ) )
AND translations.language_code IN ()
AND translations.source_language_code IS NOT NULL
AND ( posts.post_status IS NULL OR posts.post_status <> 'trash' )
made by require_once('wp-admin/admin.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('wp_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, WPMLLIBWPHooks::WPMLLIBWP{closure}, WPMLFPPromise->resolve, WPMLFPRight->chain, WPMLFPRight->map, WPMLTMATELoader::getData, WPMLTMATEJobs::getJobsWithStatus
February 6, 2024 at 1:00 pm #15271904

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Can you please let me know where you are encountering the error? Also, could you try clearing the debug log to see if the issue persists?

Could you perform a quick test with only WPML plugins enabled?

Before making any changes, it is highly recommended to take a database backup first.