将目录路径替换为mysql数据库表中的url路径 [英] replace directory path to url path in mysql database table

查看:351
本文介绍了将目录路径替换为mysql数据库表中的url路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人..在经过多次尝试和错误尝试后我放弃之前,有人可以在下面的查询中为我提供帮助吗.

我试图在"songlist"表下名为"filename"的mysql字段名称中将路径名D:\ Downloads \ Music \(注意斜线)替换为http://mysite.com/Music/. 下面是我尝试过的查询代码,但没有任何反应,它只给我以下消息:0行受到影响. (查询时间为0.1428秒)

更新歌曲列表SET文件名=替换(文件名,"D:\ Downloads \ Music","http://mysite.com/Music/")

非常感谢您的帮助!

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!!!

推荐答案

双反斜杠:replace(filename,"D:\\ Downloads \\ Music","http://mysite. com/Music/)
Double backslash: replace(filename, "D:\\Downloads\\Music", "http://mysite.com/Music/")


尝试将@放在文本字符串路径之前.
Try putting @ before your text string paths.


不要用单引号('')代替双引号()?
Shouldn''t be single quote('') instead of double quote(")?


这篇关于将目录路径替换为mysql数据库表中的url路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆