How to add a prefix to a field’s value
Posted on August 30, 2008, under PHP,
Bookmark it
Greetings,
Ever wanted to add a preffix to a mysql field’s value? The CONCAT string function can help you. Here’s how you can do it:
UPDATE `your_table` SET field_name = CONCAT('my prefix here ', field_name)
where field_name='the field value here'; #optional condition
Example: You can use this command to add a prefix for a telephone number.
Good luck!
Do you wish to receive the latest updates as soon as they are posted? Get our RSS Feed or Subscribe to the Newsletter!
- August 30, 2008
- article by Gabriel C.
- 1 comment
Related Posts
-
How to add a suffix to a field’s valueat August 30, 2008
-
Checking the beginning of a string (prefix)at August 30, 2008 with 1 comment
-
Update table field by replacing a string value with a new oneat August 28, 2008
-
Create, Customize and Send Newsletters: MeeNewsat August 3, 2009 with 3 comments
-
How to make an alphabetical searchat August 30, 2008

One Reply to "How to add a prefix to a field’s value"
November 27, 2009 at 12:19 PM
Brilliant tip worked a treat.