Page 2 of 2

Posted: Mon Dec 01, 2003 2:00 pm
by infolock
it's because some of your fields are blank. you need to put in an IF clause that checks each of those records to ensure that they are not blank before it posts. something like :

Code: Select all

foreach ($columns as $column) 
{ 
      for($i=0; $i<=count($distro); $i++) 
      { 
         $sql="SELECT sum(".$column.") FROM distreport03 where RptDist  = '".$distro[$i]."'"; 
         $result=mysql_query($sql); 
         $rows=mysql_fetch_assoc($result); 
         if(($rows[$column] != '') or ($rows[$column] != 0) or ($rows['RptDist'] != ''))
         {
            $cols[] = $column; 
            $distrib[] = $distro[$i]; 
            $total[] = $rows['sum('.$column.')']; 
         } 
}

Posted: Mon Dec 01, 2003 2:10 pm
by nwoutback
It's blanking out the page again ...

Posted: Mon Dec 01, 2003 2:14 pm
by nwoutback
some of the $columns' values are blank, but never the distributor or the column names.