CARASS
CARASS

Reputation: 245

Mass update values from the rown in MYSQL

How can i update all the fields from a certain row within Mysql database . By DB is : bookinga_Hotels The Tabele is : HotelList The column with the value that i need to update is : HotelImages And i want to update all the rows where "image.metglobal.com" with "bookingassist.ro"

Have any ideea on how to do this?

Upvotes: 0

Views: 47

Answers (2)

Abhik Chakraborty
Abhik Chakraborty

Reputation: 44844

You can use as

update HotelList
set HotelImages = 'bookingassist.ro'
where HotelImages = 'image.metglobal.com'

If you have mix of strings along with the image url then you can use replace

update HotelList
set HotelImages = replace(HotelImages,'image.metglobal.com','bookingassist.ro');

Upvotes: 1

adrCoder
adrCoder

Reputation: 3275

All you need to do is to execute this MySQL query :

update HotelList 
set HotelImages = 'bookingassist.ro'
where HotelImages = 'image.metglobal.com'

Upvotes: 0

Related Questions