I have a script that prints out the latest conditons for several stations for a given time.
My sql looks like:
$query = "SELECT * FROM ".$product.", Stations WHERE (".$product.".FMFP_ID=Stations.FMFP_ID) AND (Stations.Grp IN(" . stripslashes($choice) . ")) AND (Stations.Forecast LIKE 'y') ORDER by 'Date_Valid' DESC,'Grp','District'";
Now this works fine. But sometimes the data from a station is not in the db when this string page is called. Right now, the station is just skipped as it only prints the stations for which records exist.
What type of idea do I need to implement to get it to print "--" or something for missing stations without having to hard code each station in?
For example, Stations table has:
Station1
Station2
Station3
Station4
Station5
$product table only has records for"
Station1
Station2
Station4
What gets printed is
Station1
Station2
Station4
What I want printed is
Station1
Station2
Station4
So how do I say if the Station# exists in the Stations table, but not in the $product table, do something??
Many, many thanks.