I want to exclude company_id 18 from this code... Below code is currently working, but there is a problem only display the company those have rating. I want to exclude some companies from this list.
<?php
//$selCompanyNav2 = mysql_query("select * from tbl_company WHERE status = 'Y' ORDER BY ordering ASC");
$selCompanyNav2 = mysql_query("SELECT c.*,r.`term_id`,avg( r.post_rate_value ) AS rate_value FROM tbl_company AS c
INNER JOIN tbl_rating AS r
INNER JOIN clewin_posts AS p ON r.`term_id`=c.`term_id` AND r.post_ID=p.ID AND p.post_status='publish'
GROUP BY r.term_id ORDER BY rate_value DESC ");
$num_resultsNav2= @mysql_num_rows($selCompanyNav2);
if($num_resultsNav2>0){
?>
<ul>
<?php
while($rowNav2 = mysql_fetch_assoc($selCompanyNav2)){
$titleNav2 =$rowNav2['company_name'];
if($rowNav2['alttitle']){ $alttitle2=$rowNav2['alttitle'];}else{$alttitle2=$rowNav2['company_name'];}
$company_seotitleNav2=$rowNav2['company_seotitle'];
?>
<li>
<a href="<?php bloginfo('wpurl'); ?>/window-companies/<?php echo $company_seotitleNav2;?>/" title=""><?php echo $titleNav2;?></a>
</li>
<?php } ?>
</ul>
<?php } ?>