Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
How run two or more SQL queries together in the same line command?
I want run multiple queries (sql) in the same line command to Update image URLs in my database of WordPress.
How I run that command connecting the comands of updates?
UPDATE wpposts SET postcontent = replace(postcontent, ’http://oldurl.com/image/image1.jpg’, http://newurl.com/image/image1.jpg’);
UPDATE wpposts SET postcontent = replace(postcontent, ’http://oldurl.com/image/image2.jpg’, http://newurl.com/image/image2.jpg’);
UPDATE wpposts SET postcontent = replace(post_content, ’http://oldurl.com/image/image3.jpg’, http://newurl.com/image/image3.jpg’);
I am using nginx - Ubuntu 14.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×