I found that function but it only seems to allow you to give it a known 
string rather than a field to check.

I ran the following query:

SELECT REPLACE(content.content, 'index.cfm/', 'index.cfm?fuseaction=')
FROM content
WHERE contentid = 34

All this returns is the content field but does change the actual text.

Any ideas.  Can I do it via CF as in do a select on each content record, 
replace the bits using Replace() then update those records with the changes?

I'd rather get the db to do it.

Cheers

Dave

At 12:47 3/18/2003 +0000, you wrote:
>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
                                

Reply via email to