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 Richard MacCutchan 269
1 Aajmot Sk 252
2 Marcin Kozub 235
3 Sergey Alexandrovich Kryukov 185
4 Praneet Nadkar 167
0 OriginalGriff 7,913
1 Sergey Alexandrovich Kryukov 7,232
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,865


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.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