Click here to Skip to main content
12,405,700 members (64,008 online)
Rate this:
 
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 15:08pm
Updated 30-Apr-11 16: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 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 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160721.1 | Last Updated 1 May 2011
Copyright © CodeProject, 1999-2016
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