Lucif Posted July 16, 2017 Share Posted July 16, 2017 Hello, I need to search and replace a lot in the database and i can use this code: UPDATE ps_product_lang SET meta_title = REPLACE(meta_title, 'aapje', 'beertje'); But i have also a condition. The condition is: only replace IF id_shop = 4 How can i use that condition in the mysql code? Link to comment Share on other sites More sharing options...
pedepot Posted July 16, 2017 Share Posted July 16, 2017 Hello, the Id of shop is stored in the colunm id_shop of the table ps_product_lang. You would need to update your query with the condition WHERE : UPDATE ps_product_lang SET meta_title = REPLACE(meta_title, 'aapje', 'beertje') WHERE id_shop=4; I have not tried it. Please check Best regards Link to comment Share on other sites More sharing options...
Lucif Posted July 17, 2017 Author Share Posted July 17, 2017 Thank you, it works! Link to comment Share on other sites More sharing options...
pedepot Posted July 23, 2017 Share Posted July 23, 2017 I am glad it works! Good luck with Prestashop Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now