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` 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. 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? 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); 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). 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
Archived
This topic is now archived and is closed to further replies.