ballouta Posted April 23, 2009 Share Posted April 23, 2009 Hello, is it possible to replace some strings in a table without using PHP. e.g.: a longtext field contains paragraphs <p align='left' dir='lrt'> lablablab </p> I want to replace ALL <p align='left' dir='lrt'> strings with <p align='right' dir='rtl'> Thank you Quote Link to comment https://forums.phpfreaks.com/topic/155399-solved-replace-query/ Share on other sites More sharing options...
gffg4574fghsDSGDGKJYM Posted April 23, 2009 Share Posted April 23, 2009 You can search/replace text in a cell with a SQL query : http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace But i really don't think it's a good idea to store HTML/XHTML code in a database. Quote Link to comment https://forums.phpfreaks.com/topic/155399-solved-replace-query/#findComment-817713 Share on other sites More sharing options...
fenway Posted April 23, 2009 Share Posted April 23, 2009 No only is it not a good idea, it's a terrible one.... leave the formatting to the WEB. Quote Link to comment https://forums.phpfreaks.com/topic/155399-solved-replace-query/#findComment-817721 Share on other sites More sharing options...
ballouta Posted April 23, 2009 Author Share Posted April 23, 2009 Thank you the fucntion is clear and nice And I agree with you 100%, I don't recommend sroring HTML codes but someone asked me to setup a text editor for some inputs for his website... I told him it destroys your design, esp when he added tables and such things.. very bad Thanks alot Quote Link to comment https://forums.phpfreaks.com/topic/155399-solved-replace-query/#findComment-817726 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.