Click here to Skip to main content
11,488,212 members (82,918 online)
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 489
1 OriginalGriff 353
2 Advay Pandya 155
3 Mehdi Gholam 145
4 Sascha Lefèvre 135
0 Sergey Alexandrovich Kryukov 9,308
1 OriginalGriff 8,352
2 Sascha Lefèvre 3,334
3 Maciej Los 2,956
4 Richard Deeming 2,370


Advertise | Privacy | Mobile
Web02 | 2.8.150520.1 | Last Updated 1 May 2011
Copyright © CodeProject, 1999-2015
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