sparky1977
asked on
sql query failing for wordpress
Hi All,
Wordpress latest version with formbuilder 0.86 on MySQL, cannot edit forms with error: your form failed to save.
I have captured the SQL query being passed which is...
SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes'
UPDATE `wp_options` SET `option_value` = '1297858071' WHERE `option_name` = '_transient_doing_cron'
SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('category') ORDER BY t.name ASC
SELECT * FROM wp_posts WHERE (post_type = 'page' AND post_status = 'publish') ORDER BY post_title ASC
SELECT * FROM wp_users WHERE user_login = 'washhouseadmin'
SELECT user_id, meta_key, meta_value FROM wp_usermeta WHERE user_id IN (1)
SELECT option_value FROM wp_options WHERE option_name = 'db_upgraded' LIMIT 1
SELECT comment_approved, COUNT( * ) AS num_comments FROM wp_comments GROUP BY comment_approved
SELECT option_value FROM wp_options WHERE option_name = 'dismissed_update_core' LIMIT 1
SELECT option_value FROM wp_options WHERE option_name = 'menu_items' LIMIT 1
UPDATE `wp_formbuilder_forms` SET `name` = 'A New Contact Form', `subject` = 'Enquiry From Wash House Web Site', `recipient` = 'username@domain.com, `method` = 'POST', `action` = '', `thankyoutext` = '', `autoresponse` = '' WHERE `id` = '1'
SELECT * FROM wp_formbuilder_forms WHERE id = '1'
SELECT * FROM wp_formbuilder_responses
SELECT * FROM wp_formbuilder_fields WHERE form_id = 1 ORDER BY display_order ASC
The error message is...
Error Code: 1064
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 'UPDATE `wp_options` SET `option_value` = '1297858071' WHERE `option_name` = '_tr' at line 2
The error seems to show a truncated option name at the end '_tr' rather than the full name in the query, the option name does exist.
If i run the query without the Select statement above it works.
This is holding up some web development so i really need the help!
Many Thanks in anticipation!
Wordpress latest version with formbuilder 0.86 on MySQL, cannot edit forms with error: your form failed to save.
I have captured the SQL query being passed which is...
SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes'
UPDATE `wp_options` SET `option_value` = '1297858071' WHERE `option_name` = '_transient_doing_cron'
SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('category') ORDER BY t.name ASC
SELECT * FROM wp_posts WHERE (post_type = 'page' AND post_status = 'publish') ORDER BY post_title ASC
SELECT * FROM wp_users WHERE user_login = 'washhouseadmin'
SELECT user_id, meta_key, meta_value FROM wp_usermeta WHERE user_id IN (1)
SELECT option_value FROM wp_options WHERE option_name = 'db_upgraded' LIMIT 1
SELECT comment_approved, COUNT( * ) AS num_comments FROM wp_comments GROUP BY comment_approved
SELECT option_value FROM wp_options WHERE option_name = 'dismissed_update_core' LIMIT 1
SELECT option_value FROM wp_options WHERE option_name = 'menu_items' LIMIT 1
UPDATE `wp_formbuilder_forms` SET `name` = 'A New Contact Form', `subject` = 'Enquiry From Wash House Web Site', `recipient` = 'username@domain.com, `method` = 'POST', `action` = '', `thankyoutext` = '', `autoresponse` = '' WHERE `id` = '1'
SELECT * FROM wp_formbuilder_forms WHERE id = '1'
SELECT * FROM wp_formbuilder_responses
SELECT * FROM wp_formbuilder_fields WHERE form_id = 1 ORDER BY display_order ASC
The error message is...
Error Code: 1064
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 'UPDATE `wp_options` SET `option_value` = '1297858071' WHERE `option_name` = '_tr' at line 2
The error seems to show a truncated option name at the end '_tr' rather than the full name in the query, the option name does exist.
If i run the query without the Select statement above it works.
This is holding up some web development so i really need the help!
Many Thanks in anticipation!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
No other acceptable solution proposed.
I'm not very familiar with Wordpress, but these queries looks fine to me. The error seems like a missing delimiter issue.
The queries are stored in some file exactly as you posted them and they are executed at once? If yes, there should a delimiter at the end of each command.