Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 15:00 8:00 – 15:00 8:00 – 15:00 8:00 – 15:00 8:00 – 15:00 -
- 16:00 – 17:00 16:00 – 17:00 16:00 – 17:00 16:00 – 17:00 16:00 – 17:00 -

Supporter timezone: Europe/Rome (GMT+02:00)

This topic contains 16 replies, has 2 voices.

Last updated by Alejandro 7 months, 2 weeks ago.

Assisted by: Alejandro.

Author Posts
August 31, 2023 at 11:11 am #14319819

attiahA

i face this error in my log error

and it's repeated every seconds

[31-Aug-2023 11:00:07 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 'WHERE post_name = 'study-room-decoration' AND post_type IN ('post', 'page', 'at' at line 7 for query
SELECT post_type, post_name
FROM wp_posts p
LEFT JOIN wp_icl_translations wpml_translations
ON wpml_translations.element_id = p.ID
AND CONCAT('post_', p.post_type) = wpml_translations.element_type
AND
WHERE post_name = 'study-room-decoration' AND post_type IN ('post', 'page', 'attachment', 'e-landing-page', 'elementor_library', 'product', 'sfwd-courses', 'sfwd-lessons', 'sfwd-topic', 'sfwd-quiz', 'ld-exam', 'sfwd-certificates', 'groups', 'sfwd-essays', 'sfwd-assignment', 'etn', 'etn-schedule', 'etn-speaker', 'etn-zoom-meeting')
AND ( post_status = 'publish'
OR ( post_type = 'attachment'
AND post_status = 'inherit' ) )
ORDER BY post_type = 'page' ASC, CASE wpml_translations.language_code WHEN 'ar' THEN 3 WHEN 'en' THEN 1 ELSE 0 END DESC , CASE p.post_type WHEN 'page' THEN 2 WHEN 'post' THEN 1 ELSE 0 END DESC
LIMIT 1 made by require('wp-blog-header.php'), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts, WP_Query->parse_query, do_action_ref_array('parse_query'), WP_Hook->do_action, WP_Hook->apply_filters, SitePress->parse_query, WPML_Query_Parser->parse_query, WPML_Query_Parser->maybe_adjust_name_var, WPML_404_Guess->guess_cpt_by_name, WPML_404_Guess->find_post_type, QM_DB->query

August 31, 2023 at 11:48 am #14320389

attiahA

the error is crazy growing up my log file
please response to my problem quickly

August 31, 2023 at 12:47 pm #14320675

attiahA

to save time and focus in problem solving and before you ask to disable all plugins and activate the default theme

i have do this and the only plugin active is your plugin only

i get the same error

[31-Aug-2023 12:45:21 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 'WHERE post_name = 'insulation-in-buildings' AND post_type IN ('post', 'page', '' at line 7 for query
SELECT post_type, post_name
FROM wp_posts p
LEFT JOIN wp_icl_translations wpml_translations
ON wpml_translations.element_id = p.ID
AND CONCAT('post_', p.post_type) = wpml_translations.element_type
AND
WHERE post_name = 'insulation-in-buildings' AND post_type IN ('post', 'page', 'attachment')
AND ( post_status = 'publish'
OR ( post_type = 'attachment'
AND post_status = 'inherit' ) )
ORDER BY post_type = 'page' ASC, CASE wpml_translations.language_code WHEN 'ar' THEN 3 WHEN 'en' THEN 1 ELSE 0 END DESC , CASE p.post_type WHEN 'page' THEN 2 WHEN 'post' THEN 1 ELSE 0 END DESC
LIMIT 1 made by require('wp-blog-header.php'), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts, WP_Query->parse_query, do_action_ref_array('parse_query'), WP_Hook->do_action, WP_Hook->apply_filters, SitePress->parse_query, WPML_Query_Parser->parse_query, WPML_Query_Parser->maybe_adjust_name_var, WPML_404_Guess->guess_cpt_by_name, WPML_404_Guess->find_post_type, QM_DB->query

give me a direct and clear answer and solution

August 31, 2023 at 1:39 pm #14321127

attiahA

many errors every second

31-Aug-2023 13:38:06 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 'WHERE post_name = 'learners-work' AND post_type IN ('post', 'page', 'attachment' at line 7 for query
SELECT post_type, post_name
FROM wp_posts p
LEFT JOIN wp_icl_translations wpml_translations
ON wpml_translations.element_id = p.ID
AND CONCAT('post_', p.post_type) = wpml_translations.element_type
AND
WHERE post_name = 'learners-work' AND post_type IN ('post', 'page', 'attachment', 'e-landing-page', 'elementor_library', 'product', 'sfwd-courses', 'sfwd-lessons', 'sfwd-topic', 'sfwd-quiz', 'ld-exam', 'sfwd-certificates', 'groups', 'sfwd-transactions', 'sfwd-essays', 'sfwd-assignment', 'etn', 'etn-schedule', 'etn-speaker', 'etn-zoom-meeting')
AND ( post_status = 'publish'
OR ( post_type = 'attachment'
AND post_status = 'inherit' ) )
ORDER BY post_type = 'page' DESC, CASE wpml_translations.language_code WHEN 'ar' THEN 3 WHEN 'en' THEN 1 ELSE 0 END DESC , CASE p.post_type WHEN 'page' THEN 2 WHEN 'post' THEN 1 ELSE 0 END DESC
LIMIT 1 made by require('wp-blog-header.php'), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts, WP_Query->parse_query, do_action_ref_array('parse_query'), WP_Hook->do_action, WP_Hook->apply_filters, SitePress->parse_query, WPML_Query_Parser->parse_query, WPML_Query_Parser->maybe_adjust_name_var, WPML_404_Guess->guess_cpt_by_name, WPML_404_Guess->find_post_type, QM_DB->query

August 31, 2023 at 1:41 pm #14321143

attiahA

all error and database error related to WPML and also shown in Query Monitor

error.jpg
September 1, 2023 at 2:15 pm #14327247

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

You mention that it happens when the plugin alone is being active but the screenshot you sent me actually mentions the problem is witha post type called "learners-work" which i suppose come from another plugin.

The error is that WPML is trying to find that post type but it seems like it doesn't exist anymore, or well, WPML can't find it.

I suspect it comes from Learndash, since it seems LMS related.

Please try the following:

1) Go to WPML > Settings > post type translation > find this learners-work and let us know what translation preference it has (is it translatable or set to "not translatable"?) do not change anything here yet.

2) Make sure you have configured learndash and WPML using this guide: https://wpml.org/documentation/plugins-compatibility/how-to-create-multilingual-online-courses-websites-using-learndash-and-wpml/

3) Go to WPML -> Support -> Troubleshooting

Press the following buttons:

• "Clear the cache in WPML"
• "Remove ghost entries from the translation tables"
• "Fix element_type collation"
• "Set language information"
• "Fix post type assignment for translations"

4) Check if you have a server-side cache and flush it if you do.

A supporter will take your case soon and these steps are just to get you started. let us know how it goes so we can help you out.

Regards.

September 1, 2023 at 2:49 pm #14327573

attiahA

at the first thanks for reply
1- learners-work is a just page not a post type
check it here
hidden link

all steps in 2 , 3 , 4 done

but

the problem not solve and still reported every milliseconds in my debug.log
it's reported in any page or any post opened

the problem not related to any plugin only related to WPML

i have disable all plugins completely
and switch to the default theme and the problem appear aging in my dubug.log

please focus in WPML the problem related to it

hope i get a solution soon

September 1, 2023 at 2:58 pm #14327639

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

You're right, sorry, it was a post name, not post type.

I can see that for some reason the query is basically adding an extra AND and that's why it's being repeated everytime. weirdly, this seems like an incident happening to you only at the moment (i literally was checking the database queries on another site and this never happened there).

Cna you try to see if the beta version we released helps here? https://wpml.org/faq/how-to-install-beta-and-development-versions-of-wpml/

If that doesn't help, then could you create a staging site or even better yet send us a snapshot of your site (please try to remove backup files, media or other unimportant elements that could make the snapshot increase in site) so i can send it to our developers and have them find out why is the query being created incorrectly?

You can upload the snapshot to google drive, wtransfer or any other similar platform and send us the link so we can download it.

Regards.

----------------

P.S: if you notice that we don't answer right away, is just because there are high traffic days or weekends in between that make the tickets be idle for longer.

September 1, 2023 at 3:04 pm #14327695

attiahA

hello
how can i send to you a copy from my website as your request ?

give me the steps and tell me what is the time i will get a solution

my website is a production website and any error like this will make to our business a big problems

September 1, 2023 at 3:08 pm #14327701

attiahA

can you take a look to my website and WPML setting or this error not related to the setting ?

give me your favor steps for staging backup you want me to send it to you for my website

September 1, 2023 at 3:12 pm #14327711

attiahA

now i try to update to your beta as your suggestions but i think your server update have a problems

failed.jpg
September 1, 2023 at 3:24 pm #14327757

attiahA

now i success to update the WPML to 4.6.6-b.1 and String translation to 3.2.8.b.2

and i confirm the problem not solved and the error recorder in my debug.log in every visits to any page or post in my website

now

give me your favor steps for staging backup you want me to send it to you for my website

and how can i send it to you .. in email or what is the correct way ?

September 1, 2023 at 5:32 pm #14328339

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

For the backup/snapshot of your site, you can use a plugin like duplicator, updraft, all in one migration or any other that you like (but please tell me which one you used and how i can restore it if you use a different one from the ones i mentioned).

Make sure you do not add the media, backup, zip files or other heavy files to the backup (it's an option on every backup plugin solution out there) or the result could be really heavy and that would slow things down.

Basically:

- Install the plugin of your choice, for backups.
- Create a backup (excluding media files or the entire upload folder and other heavy files you may have )
- Upload the backup in a platform like wetransfer.com or google drive (any platform you like will do)

- Send the download URL to me as an answer to this thread (All the links are masked so they can only be seen by you and me)

Regards.

September 1, 2023 at 6:15 pm #14328415

attiahA

Hello
this is our website full backup using duplicator as your favor
excluded Upload folder

this is the link in wetransfer.com

hidden link

hope i get a replay with a solution soon as possible

thanks

September 4, 2023 at 9:30 am #14334935

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello sir,

The "installer.php" you sent me is not correct, it seems to have been wrongly downloaded on your end or is corrupt. when i opened the file to try to understand where was the problem, i found that the file is "cut" so it was still adding some code and something interrupted it.

Could you please re-download that file and send it over, please?

The topic ‘[Closed] SQL syntax; check the manual that corresponds to your MySQL server’ is closed to new replies.