Article 4T8GK Simple Database Query

Simple Database Query

by
xray55
from LinuxQuestions.org on (#4T8GK)
MySql57
table name: streams
field name: stream_source

Hey guys,

Im trying to edit about 235 weblinks inside a small database.

I want to remove the highlighted characters

http://domain:9595/live/USERNAME/PASSWORD/425.m3u8

and end up with streams that look like

http://domain:9595/USERNAME/PASSWORD/425

removing find/replace .m3u is easy enough but I need to also remove the word live and one of the slashes besides it so I dont end up with double slashes //

This is what I attempted

Code:update streams set stream_source = replace(stream_source, '/live/', '/');
update streams set stream_source = replace(stream_source, '.m3u8', '');
exit;
the .m3u8 is replaced with blank so that works but slash / is not replacing /live/

my understanding is that u cant search and replace slashes /

what can I do to get around this?latest?d=yIl2AUoC8zA latest?i=jQWPEe058lw:Pq5d7bOKAd4:F7zBnMy latest?i=jQWPEe058lw:Pq5d7bOKAd4:V_sGLiP latest?d=qj6IDK7rITs latest?i=jQWPEe058lw:Pq5d7bOKAd4:gIN9vFwjQWPEe058lw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments