Get the artist of a song in SQL

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Get the artist of a song in SQL

by m0nkiii » Fri Mar 02, 2007 5:43 am

Gött mos, Spanks !

I thought it was something like that but I couldn't get it to work :P

by Bex » Thu Mar 01, 2007 9:32 pm

Try this:

Code: Select all

SDB.Database.ExecSQL("UPDATE Songs INNER JOIN Artists ON Songs.IDArtist = Artists.ID SET Songs.PlayCounter = SomeNumber WHERE Songs.SongTitle = 'SomeTitle' AND Artists.Artist = 'SomeArtist' ")
The Artist name is store in the Artists table and not in the Songs table so you need to link the songs table to the Artists table. And don't forget to enclose text values with -> '

Get the artist of a song in SQL

by m0nkiii » Thu Mar 01, 2007 9:00 pm

I'm going to update the PlayCounter of some songs and I have the following code:

Code: Select all

SDB.Database.ExecSQL( "UPDATE Songs SET PlayCounter= WHATEVER WHERE (Songs.SongTitle = WHATEVER and Songs.Artist = WHATEVER)")
But Songs.Artist won't work. Neither will Songs.ArtistName etc...
Help... :roll:

Top