• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 561
  • Last Modified:

update mysql table with a prepend text

Hi,

I'd like to update a set of records where the column name='picture' where id>='1'.
id is the primary key, auto increment field.

The picture field has values like:
/dev/images/profile/2-6-1.png

But I'd like like to prepend the url with:
http://cosmeticguide.com/
so the picture field values should be:
http://cosmeticguide.com/dev/images/profile/2-6-1.png

How do I do this with one mysql statement?

Thank you,
vkimura
0
Victor Kimura
Asked:
Victor Kimura
1 Solution
 
theGhost_k8Database ConsultantCommented:
update tablename set pictureField=concat('http://cosmeticguide.com',pictureField);
0
 
Victor KimuraSEO, Web DeveloperAuthor Commented:
Thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now