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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.