Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MySQL string directory
Dear all..before i give up after multiple trial and error attempts,can someone please help me with below query.
 
I am trying to replace the path name D:\Downloads\Music\ (note the slash) to http://mysite.com/Music/ in mysql field name called "filename" under "songlist" table.
Below is the query code that I tried with but nothing happens.It only gives me the following message : 0 row(s) affected. ( Query took 0.1428 sec )
 
UPDATE songlist SET filename = replace(filename, "D:\Downloads\Music", "http://mysite.com/Music/")
 
many thanks for the help!!!
Posted 30-Apr-11 16:08pm
Edited 30-Apr-11 17:38pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Double backslash: replace(filename, "D:\\Downloads\\Music", "http://mysite.com/Music/")
  Permalink  
Comments
cheekycroak at 2-May-11 4:12am
   
Fantastic solution3!!! Thank you Kibab.It worked like a charm.
Many thanks to all those who responded.Below is the final code:
UPDATE songlist SET listen = replace(listen, "D:\\Downloads\\Music\\", "http://mysite.com/Music/")
kibab at 2-May-11 4:40am
   
You're welcome.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Try putting @ before your text string paths.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Shouldn't be single quote(') instead of double quote(")?
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 535
1 OriginalGriff 275
2 Shweta N Mishra 244
3 BillWoodruff 235
4 Deepu S Nair 230
0 OriginalGriff 6,168
1 Sergey Alexandrovich Kryukov 5,818
2 DamithSL 4,958
3 Manas Bhardwaj 4,539
4 Maciej Los 3,755


Advertise | Privacy | Mobile
Web02 | 2.8.1411019.1 | Last Updated 1 May 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100