[phplib] HELP - fetching arrays From: paula (paula <email protected>)
Date: 04/08/01

Hi,
I need your help.

Maybe some of you can tell me why this code is not working.
I'm checking if field 'line_action'=="D" (it can be "D", "M", "A"). If it's =="D" the I need the $key ="d_".$key
if not $key keeps the same.

/* QUERY */

$q='select * from channel_lineup_changes where channel_lineup_id="BA01" and system_num="S1D6" and activ_date="2001-06-01"';

$result=queries($q,"sql error 2!");

/* FETCH ARRAY */
while ($ret= <email protected>($result)) {
  while (list($key,$value)=each($ret)) {
    if ($key=="active_date") {
      if ($value=="D") {
        $key="d_".$key;
      }
    }
    $t->set_var(array($key=>$value));
  }
  $t->parse("chnl_lu_changes_internal","internal",true);
}