PHP Code:
//QUERY
$mycountry=@mysql_query("SELECT c.* ". "FROM country AS c ". "WHERE c.CountryID=$cid");
if (!$mycountry) {
echo("<p>Error fetching country details: " .
mysql_error() . "</p>");
exit();
}
//ASSIGNING ASSOC. ARRAY
$mycountry = mysql_fetch_array($mycountry);
//I used to use this but this is very limiting I want to try check if something exists in the db
$photo = $mycountry["photo"];
//NEW CODE TO ME TO REPLACE LINE ABOVE
$photo = $country_front if [EXISTS SELECT AlbumName FROM gallery.albumtb WHERE categoryID == 2 THEN $photo = 1];
endif;