I've got a Joomla module that essentially shows a listing of groups. Near the category title, the amount of products for the reason that particular category is displayed while using line below

 <em>(<?php echo $row->counter ;?>) </em>  

The products within the groups are going to either ‘open’, ‘close’ or ‘frozen’ and i'm attempting to make it to ensure that it only shows the amount of ‘open’ products and doesn't include any close or frozen products.

<?php

// no direct access
defined('_JEXEC') or die('Restricted access'); 

$document =& JFactory::getDocument();
$html = '<link href="'.JURI::base(). 'modules/mod_glance_categories/css/style.css" rel="stylesheet" type="text/css" />';
$document->addCustomTag( $html );

$n = 0;
if(count($rows) > 0){

?>
<table width="100%" cellpadding="0" cellspacing="0">
<?php
foreach ( $rows as $row ) 
{
 $n++;
if($n ==1){?>
<tr>   
<?php 
}
if($n <= $columns){
?>
 <td align="left" valign="top" >
 <?php $link_proj_categ = JRoute::_('index.php?option=com_glance&task=categproj&id='.$row->id);?>
 <a href="<?php echo $link_proj_categ;?>" class="tpf_tcatnode">
 <strong><?php echo $row->categories; ?></strong>
 <em>(<?php echo $row->counter ;?>) </em>
 </a>
  </td>
 <?php 
 }
 if($n == $columns){?>
  </tr> 
  <?php 
 $n =0;
   }  
}
$n++;
if($n <= $columns){
 for($x=$n;$x<=$columns;$x++){?>
  <td>&nbsp;</td>
 <?php
}?> 
 </tr> 
 <?php 
 } ?>

  </table>
  <?php } ?>

If you would like "when the status is open", your if statement need to look like:

if(count($rows) > 0 && ($row->status) == "open"){
      // Do something
}

However, inside your code, there's $n, that is unused. $rows and $row weren't initialized. $rows and $row will vary variables (I think you'll realize that part). :)

Without more detail, I'd say the way to go is among the following: (I suppose the two variables within the condition must have been exactly the same.)

if(count($rows) > 0 && $rows->status) == "open"){
if(count($rows) > 0 && $rows[0]->status == "open"){
if(count($rows) > 0 && $rows['status'] == "open"){
if(count($rows) > 0 && $rows[0]['status'] == "open"){