Jump to content

mysql code


Lucif

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...