limitphp Posted March 12, 2009 Share Posted March 12, 2009 I want to check to see if a songID exists in a playlist. What would be the bare minimum way of doing it (least resources)? this is what I am doing so far: $querySong = "SELECT COUNT(id) FROM playlist_songs WHERE songID = '$songID' AND playlistID = '$playlistID'"; $resultSong = mysql_query($querySong) or die (mysql_error()); $flagSong = mysql_result($resultSong ,0); if ($flagSong==1) //song Exists Link to comment https://forums.phpfreaks.com/topic/149156-bare-minimum-query-for-checking-if-a-value-exists/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.