Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to query to get artistname and artist album

Status
Not open for further replies.
Apr 28, 2006
69
NL
Hi all i got a table called music and it has three fields called :

url,album,artist

Currently there is only data in url field and the data inside is like this
Code:
[URL unfurl="true"]http://music.localhost.com/TtdlI3l1lIl0OOO0a/[/URL][b]artistname[/b]/[b]albumname[/b]/life too short.mp3

the artist and album feilds are empty at this moment!!. What i want for each record the value of artist and album which is shown in bold(the artist name and albumname is part of url column value) copied and placed in its artist and ablum field in the same row .I want this for all records in my db. I be happy if an expert show me how that can be done using mysql .Thanks

Rephrase:
A query that gets artistname and albuname from url feild and put them in artist and album feided for
each row of data in mysql db.
 
You could use the SUBSTRING_INDEX function. It's described in the manual.
 
If you show us what you've tried, somebody might be able to help you improve it.
 
Look in the manual under STRING FUNCTIONS. There you will see SUBSTRING_INDEX as Tony suggested. You are here asking for help. You need to do a little bit of legwork too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top