switch($pageType){ case 'home': $queryFooter = mysql_query("SELECT cf.footerLeft, cf.footerRight FROM pages p, contentFooter cf WHERE p.page = '' AND p.sub = '' AND p.id_website = $websiteId AND p.id_website = cf.id_website AND p.id_contentFooter = cf.id"); if(mysql_num_rows($queryFooter) == 1){ $footer = mysql_fetch_array($queryFooter); $footerLeft = $footer['footerLeft']; $footerRight = $footer['footerRight']; } break; case 'page-sub': $queryFooter = mysql_query("SELECT cf.footerLeft, cf.footerRight FROM pages p, contentFooter cf WHERE p.page = '$URLpage' AND p.sub = '$URLsub' AND p.id_website = $websiteId AND p.id_website = cf.id_website AND p.id_contentFooter = cf.id"); if(mysql_num_rows($queryFooter) == 1){ $footer = mysql_fetch_array($queryFooter); $footerLeft = $footer['footerLeft']; $footerRight = $footer['footerRight']; } break; case 'page': $queryFooter = mysql_query("SELECT cf.footerLeft, cf.footerRight FROM pages p, contentFooter cf WHERE p.page = '$URLpage' AND p.sub = '' AND p.id_website = $websiteId AND p.id_website = cf.id_website AND p.id_contentFooter = cf.id"); if(mysql_num_rows($queryFooter) == 1){ $footer = mysql_fetch_array($queryFooter); $footerLeft = $footer['footerLeft']; $footerRight = $footer['footerRight']; } break; } ?>