Jump to content

[SOLVED] Array issues....


maliary

Recommended Posts

 

Hi guys,

 

It seems array issues just never end.

 

I have this while loop below which displays data from a  table. These are elements with this array

$tp['name']

Inside the while loop is a counter variable which increments at every loop.  This is used to display the elements from the $rval array.

 

$rval array values have this '-' (hyphen). There is an if statement to remove these array elements, which it does apart from the very first array value $rval [0]. It never get removed. Why???

 


$tests = $db->Execute("SELECT * FROM care_test_param WHERE  group_id ='$param_gp'"); 
    while($tp = $tests->FetchRow()){ 
                      
            
       if ($rval[$counterup] != '-') 
{    
       
           
           
    <tr class=';  if($toggle) { $cache .= '"wardlistrow1"';}else { $cache .= '"wardlistrow2"';}
    >
   <td> echo '.$tp['name'].' </td>'."\n"
   <td> echo '.$tp['msr_unit'].'  </td>'."\n"
   <td> echo '.$tp['lo_bound'].'</td>'."\n"
   <td> echo '.$rval[$counterup].' </td>'."\n"            
    </tr>
    $toggle=!$toggle;  
    
    
    
    
     } 
           
     $counterup++;     
    }
      




 

Link to comment
https://forums.phpfreaks.com/topic/57726-solved-array-issues/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.