coolispaul Posted January 20, 2006 Share Posted January 20, 2006 Hi does anybody know if there is a function that i can use to prepend a string to data in every row of a particular field in the database.The problem i have is that i have a field called 'images' which contains the name of the image. However, i need to put the path to it before the name. So just want to add the path in to every row.Thanks Quote Link to comment https://forums.phpfreaks.com/topic/3234-adding-a-string-to-data-already-in-the-database/ Share on other sites More sharing options...
fenway Posted January 20, 2006 Share Posted January 20, 2006 Try the following:[code]UPDATE yourTable SET col1 = CONCAT('string to prepend',col1);[/code]Hope that helps. Quote Link to comment https://forums.phpfreaks.com/topic/3234-adding-a-string-to-data-already-in-the-database/#findComment-11023 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.