Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Howto | mysql seach and replace?
Old 11-28-2006, 03:24 AM Howto | mysql seach and replace?
Experienced Talker

Posts: 31
Trades: 0
In my database, I have two tables: Forum and Files

Files have two fields. First one is FileID and second one is FileAddress.

FileId field is fine. but in FileAddress field I have a lot of urls. I want to just change certain parts of url. For example, instead of having http://IPADDRESS/FILEPATH

I want to chage that to http://domain.com/FILEPATH for about 400 data in the sql table. How do I do this?????
desiram is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-29-2006, 01:38 AM Re: Howto | mysql seach and replace?
jito's Avatar
MY LIFE IS 'i' LIFE

Posts: 565
Name: surajit ray
Location: inside the heart of my friends
Trades: 0
you need a stored procedure, chk this example:
http://vyaskn.tripod.com/sql_server_...nd_replace.htm
__________________
I am not smart, that's why i don't act smart


Please login or register to view this content. Registration is FREE
jito is offline
Reply With Quote
View Public Profile
 
Old 11-29-2006, 02:15 PM Re: Howto | mysql seach and replace?
Novice Talker

Posts: 10
Trades: 0
you can also use mysql REPLACE function

like
Code:
 
UPDATE Files SET FileAddress = REPLACE(FileAddress,'IPADDRESS','DOMAIN')
Note: make sure to backup db before doing trick.
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
!!harsh789 is offline
Reply With Quote
View Public Profile Visit !!harsh789's homepage!
 
Reply     « Reply to Howto | mysql seach and replace?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20570 seconds with 12 queries