23.09.2016, 12:24
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
Which you can combine with your other queries.
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 |