PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old October 13th, 2002, 09:57 PM
JeT JeT is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 28 JeT User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to JeT
I need help pretty bad right now. - mySQL modifying.

I am relocating all my downloads to a new server. But I am keeping the same filename.

Can I make a script to go through the database and explode the url to just the filename, and then put in the NEW location before the filename???

Cuz I can't manually go through 300 files.

Reply With Quote
  #2  
Old October 13th, 2002, 10:30 PM
JeT JeT is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 28 JeT User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to JeT
RE: I need help pretty bad right now. - mySQL modifying.

help. heh.

Reply With Quote
  #3  
Old October 13th, 2002, 11:22 PM
JeT JeT is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 28 JeT User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to JeT
RE: I need help pretty bad right now. - mySQL modifying.

ummm....

Reply With Quote
  #4  
Old October 13th, 2002, 11:29 PM
spidermonster spidermonster is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Newcomerstown, ohio, usa
Posts: 151 spidermonster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to spidermonster Send a message via Yahoo to spidermonster
RE: I need help pretty bad right now. - mySQL modifying.

you cant expect help that fast from a forums,,, if i knew anything about what your talking about i would try, but for what you want, is really out of my league, im sure someone from here will answer your question,,, but i cant exactly tell you when,,,hope soon...sorry...

Reply With Quote
  #5  
Old October 14th, 2002, 12:31 AM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
RE: I need help pretty bad right now. - mySQL modifying.

Check out the REPLACE function of mysql..you can do things like:

UPDATE table set somefield = REPLACE(somefield, 'oldvalue','newvalue')

http://www.mysql.com/doc/en/String_functions.html

Reply With Quote
  #6  
Old October 14th, 2002, 01:18 AM
JeT JeT is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 28 JeT User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to JeT
RE: I need help pretty bad right now. - mySQL modifying.

I now of that command, but I need to actually take the filename out of the old value, and add it to the end of the new value.

SOmething similar to exploding it? Cept I am not too good at that...

Please help?

Reply With Quote
  #7  
Old October 14th, 2002, 01:26 AM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
RE: I need help pretty bad right now. - mySQL modifying.

REPLACE will work..let's say that somefield has a value of /home/joe/www/filename.txt and you want to replace /home/joe/www/ with /home/john/htdocs/ :

UPDATE table SET somefield = REPLACE(somefield, '/home/joe/www/', '/home/john/htdocs/')

will do that...somefield would now look like /home/john/htdocs/filename.txt

I recommend making a backup of your table..then running a command such as that...remember, always back up...

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > I need help pretty bad right now. - mySQL modifying.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway