Hello List!

I have some code like:

    while( $sth->fetch() ) {
         push(@id, $col_id);
         push(@firstname, $col_firstname);
         push(@lastname, $col_lastname);
         push(@address, $col_address);
         push(@phone, $col_phone);
         push(@email, $col_email);
         push(@code, $col_code);
         push(@function, $col_function);
         push(@confirmed, $col_confirmed);
    }
    $sth->finish;
    my $params = {
        'id' => @id,
        'firstname' => @firstname,
        'lastname' => @lastname,
        'address' => @address,
        'phone' => @phone,
        'email' => @email,
        'code' => @code,
        'function' => @function,
        'confirmed' => @confirmed,
        };

Where $col_foo is a MySQL column bound with $sth->bind_columns. For the sake of testing, I have left out any smartness. Eventually the idea is to take "confirmed" and convert it to a nicer true/false, hide ID, and do some formatting to "function". At the moment, I'm trying to test the code. My template follows:

    [% FOREACH id %]
    <b>id:</b>  [% id %]<br>
    <b>First Name:</b>  [% firstname %]<br>
    <b>Last Name:</b>  [% lastname %]<br>
    <b>Address:</b>  [% address %]<br>
    <b>Phone Number:</b>  [% phone %]<br>
    <b>E-Mail Address:</b>  [% email %]<br>
    <b>Code:</B>  [% code %]<br>
    <b>Function:</B>  [% function %]<br>
    <b>Confirmed:</B>  [% confirmed %]<br>
    <hr><br>
    [% END %]

Unfortunately, this results in the first result displayed and it fails to iterate over the array of data. How might I get this to iterate through the arrays?

Thanks,
Josh


_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to