I am currently running this query inside MySQL to check if the specified values exists
within the table associated with them.
SELECT COUNT(artist.artist_id), COUNT(album.album_id), COUNT(tracks.track_id)
FROM artist, album, tracks WHERE artist.artist_id = 320295 OR album.album_id = 1234 OR tracks.track_id = 809
The result I get from running this query is all 1, meaning that all the statements after the WHERE clause is true. To further check the query’s reliability, I changed the tracks.track_ = 809 to 802, which I know does not match. However the results displayed are still all 1, meaning that they were all successfully matched even when I purposefully inserted a value which would not have matched.
How do I get it to show 1 for a match and 0 for no matches within the same query?
EDIT: I have inserted an image of the query running

What you do here is a join over three tables. You can see what happens, when you look at this SQL Fiddle.
In the first select, I have left out the
count, to show how the join works. You can also see how the result set changes, when you modify the where clause fromortoandas @RayPaseur suggested.I guess, what you want, is really three separate queries
which becomes
Now, when you change
track_id = 809totrack_id = 802, you will getas a result.
SQL Fiddle for playing.