jasonc Posted December 30, 2011 Share Posted December 30, 2011 I thought this might work and even tried to use a + instead of the . (dot) cause the whole table to have zeros ! lol ok back to previous backup made moments before. and not sure how i add text to the links, please can someone advise. UPDATE `links` SET `link` = 'http://www.'.`link` Quote Link to comment https://forums.phpfreaks.com/topic/254092-add-text-to-start-of-field-data/ Share on other sites More sharing options...
Pikachu2000 Posted December 30, 2011 Share Posted December 30, 2011 You'll want to use MySQL's CONCAT() function for this. Quote Link to comment https://forums.phpfreaks.com/topic/254092-add-text-to-start-of-field-data/#findComment-1302642 Share on other sites More sharing options...
jasonc Posted December 30, 2011 Author Share Posted December 30, 2011 You'll want to use MySQL's CONCAT() function for this. wow thats a new one for me. how do i use this to add http:// to all of the entries in the links field? Quote Link to comment https://forums.phpfreaks.com/topic/254092-add-text-to-start-of-field-data/#findComment-1302643 Share on other sites More sharing options...
The Little Guy Posted December 30, 2011 Share Posted December 30, 2011 update some_table set link = concat('http://', link); Quote Link to comment https://forums.phpfreaks.com/topic/254092-add-text-to-start-of-field-data/#findComment-1302650 Share on other sites More sharing options...
fenway Posted December 30, 2011 Share Posted December 30, 2011 Or, if you're an ANSI SQL freak, you can use || (if ansi mode is on). Quote Link to comment https://forums.phpfreaks.com/topic/254092-add-text-to-start-of-field-data/#findComment-1302673 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.