Fixing Broken Image Links / SQL Query Code in phpMyAdmin
Hello - I'm hoping someone can help me out with what appears to be a syntax error in an SQL query in myPHPAdmin. Thanks in advance!!
I am fixing image links after copying a website into a development environment. I am following the instructions at this article. https://www.inmotionhosting.com/support/edu/wordpress/correct-image-links/
When I go into wp_posts in phpMyAdmin (in my case the table is actually called wp3i_posts) I am getting the error below. First...here's the code I entered AND also what - by default was already on Line 1 in the code box.
SELECT * FROM `wp3i_posts` WHERE 1
UPDATE wp3i_posts SET post_content=(REPLACE (post_content, ‘opsinsync.com’,’dev-ois.opsinsync.com’));
HERE'S THE ERROR MESSAGE
Error
Static analysis:
1 errors were found during analysis.
- A new statement was found, but no delimiter between it and the previous one. (near "UPDATE" at position 36)
SQL query:
SELECT * FROM `wp3i_posts` WHERE 1 UPDATE wp_posts SET post_content=(REPLACE (post_content, ‘opsinsync.com’,’dev-ois.opsinsync.com’))
MySQL said:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UPDATE wp_posts SET post_content=(REPLACE (post_content, ‘opsinsync.com’,...' at line 2
Hello Pam,
Most of us do know MySQL, but the problem is often coding can be context related and there may be 100's of different answers. So, if we don't know the overall context, we might give you good code but it may not be the best answer. When I state "coding is a little beyond the scope", I'm saying this in the general sense, because we can't provide wholesale coding solutions in this space. However, for simple queries, we can definitely give an answer and generally at least point you in the right direction.
I had another person look at it for me and he stated that after the "1" there should be some type of punctuation as they are two separate statements. He said that there should be a ";" separating them.
Hope that helps!
Totally understand. Thanks! That solution unfortunately didn't work anyway. I do appreciate your attempt at the assist though. Have a good one!