Dave, > > I have a mysql db with a table containing html content. I have links in > the content like this: index.cfm/welcome.content/cmid=2 > What I want to do is find all the links that have index.cfm/ and replace > them with index.cfm?fuseaction= > > I also want to replace the '/' after the .content so that this: > welcome.content/cmid=2 becomes welcome.content&cmid=2 > > In the end I want a url like this: index.cfm?fuseaction=welcome.content&cmid=2 > > Is there anyway to do this directly within a query? > > I don't have access via command line and can only do it using the SQL > builder in CF studio. > > Any help would be great. >
MySQL has a replace() function, this might do the trick..... http://www.mysql.com/doc/en/String_functions.html SELECT Replace(Replace(Content,"index.cfm/","index.cfm?fuseaction="),"/cmid=","&cmi d=") As FixedContent FROM ContentTable Give it a go - see what its like in reponse times.... Try it against just doing it in CF..... Regards Stephen =============================== CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=14 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=14 Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.14
