Playlist System[MySQL]
#5

Simply because there is no `PlayerPlaylistID` in playlists for song to refer to, you simply need to pass that value in your query too.
You are doing the whole foreign keys wrong tho, your schematics should look like this:

Playlists > AI ID - Name or w/e (thats all)
Songs > AI ID - PlaylistID - ( SongStream > have no idea what this is) - SongName
Players > PlayerPlaylistID
Both songs.PlaylistID and PlayerPlaylistID should refer to playlist AI ID. You can simply check how many songs are inserted in a playlist with a query
Quote:

SELECT COUNT(*) FROM `songs` WHERE PlaylistID=%i

Which you can combine with your other queries.
Reply


Messages In This Thread
Playlist System[MySQL] - by vassilis - 22.09.2016, 22:27
Re: Playlist System[MySQL] - by Shinja - 22.09.2016, 22:51
Re: Playlist System[MySQL] - by vassilis - 22.09.2016, 23:00
Re: Playlist System[MySQL] - by X337 - 23.09.2016, 03:39
Re: Playlist System[MySQL] - by PrO.GameR - 23.09.2016, 12:24

Forum Jump:


Users browsing this thread: 2 Guest(s)