|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
RE: I need help pretty bad right now. - mySQL modifying.
|
|
#3
|
|||
|
|||
|
RE: I need help pretty bad right now. - mySQL modifying.
ummm....
|
|
#4
|
|||
|
|||
|
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...
|
|
#5
|
|||
|
|||
|
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 |
|
#6
|
|||
|
|||
|
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? |
|
#7
|
|||
|
|||
|
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... |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > I need help pretty bad right now. - mySQL modifying. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|