How do I add characters to end of multiple field data?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

How do I add characters to end of multiple field data?

Post by simonmlewis »

We have 400+ filenames in a database, ie. 45454343. I need to change them all to 45454343.jpg for instance. So they all have ".jpg" put on the end.

How can this be done, via phpMyAdmin? I'm assuming it some kind of "replace" function, but not sure.

Simon
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: How do I add characters to end of multiple field data?

Post by requinix »

Do an UPDATE and use the CONCAT function.
Post Reply