Topshed Posted January 22, 2009 Share Posted January 22, 2009 G'day all, MySQL4.0 PHP5 I have a few hundred records where I want to replace stuff to the begining of the field and keep the end bit which is differant in every record. and I am trying to do this in phpmyadmin without a wild card it works fine UPDATE food SET notes = replace(notes,'Rhubarb Apples and custard Menu 506','Rhubarb Apples Custard and strawberries Menu 506 ') WHERE Class LIKE 'Food' Problem is the number at the end changes with every record so the last bit needs to be treated as a wild card to retain that bit of the varchar I have been playing around with this but I cannot come up with the answer, any suggestion s would be most appreaciated Thanks Roy... Link to comment https://forums.phpfreaks.com/topic/141919-replace-part-of-a-varchar/ Share on other sites More sharing options...
dvd420 Posted January 22, 2009 Share Posted January 22, 2009 Hi, You can manupulate the strings (notes) in PHP easily. Bind vars can also be used. Link to comment https://forums.phpfreaks.com/topic/141919-replace-part-of-a-varchar/#findComment-743143 Share on other sites More sharing options...
landavia Posted January 22, 2009 Share Posted January 22, 2009 how about.. parse all using csv and try fix from the csv.. is wise to replace outside the DB than from the DB itself Link to comment https://forums.phpfreaks.com/topic/141919-replace-part-of-a-varchar/#findComment-743148 Share on other sites More sharing options...
Topshed Posted January 24, 2009 Author Share Posted January 24, 2009 Thank you both for your suggestions, which I am working on, but having trouble with my ISP's phpmyadmin (ticket Raised) Regards Topshed Link to comment https://forums.phpfreaks.com/topic/141919-replace-part-of-a-varchar/#findComment-744888 Share on other sites More sharing options...
landavia Posted January 25, 2009 Share Posted January 25, 2009 i believe.. the problem is not in yours phpmyadmin but in the length of your sql.. can you split it before import to mysql? Link to comment https://forums.phpfreaks.com/topic/141919-replace-part-of-a-varchar/#findComment-745864 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.