Hi all,
Having an issue with looping through the records of a data table and rendering them onto a web page. In this case, there are 4 records in the table.
This is the code I'm trying to use:
@row = $sth->fetchrow_array;
foreach $row (@row){
print<<EOF;
acctnbr = $row[0]<br>
inv_nbr = $row[1]<br>
inv__date = $row[2]<br>
inv_amt = $row[3]<br>
proj_type = $row[4]<br>
pay_month = $row[5]<br>
EOF
}
This is the result:
acctnbr = 9999
inv_nbr = 3119
inv__date = 2011-01-01
inv_amt = 150
proj_type = M
pay_month = 01
acctnbr = 9999
inv_nbr = 3119
inv__date = 2011-01-01
inv_amt = 150
proj_type = M
pay_month = 01
acctnbr = 9999
inv_nbr = 3119
inv__date = 2011-01-01
inv_amt = 150
proj_type = M
pay_month = 01
acctnbr = 9999
inv_nbr = 3119
inv__date = 2011-01-01
inv_amt = 150
proj_type = M
pay_month = 01
acctnbr = 9999
inv_nbr = 3119
inv__date = 2011-01-01
inv_amt = 150
proj_type = M
pay_month = 01
acctnbr = 9999
inv_nbr = 3119
inv__date = 2011-01-01
inv_amt = 150
proj_type = M
pay_month = 01
Each "grouping" is the first record! What am I missing to get this to iterate through the records?
Thanks for your help!
Having an issue with looping through the records of a data table and rendering them onto a web page. In this case, there are 4 records in the table.
This is the code I'm trying to use:
@row = $sth->fetchrow_array;
foreach $row (@row){
print<<EOF;
acctnbr = $row[0]<br>
inv_nbr = $row[1]<br>
inv__date = $row[2]<br>
inv_amt = $row[3]<br>
proj_type = $row[4]<br>
pay_month = $row[5]<br>
EOF
}
This is the result:
acctnbr = 9999
inv_nbr = 3119
inv__date = 2011-01-01
inv_amt = 150
proj_type = M
pay_month = 01
acctnbr = 9999
inv_nbr = 3119
inv__date = 2011-01-01
inv_amt = 150
proj_type = M
pay_month = 01
acctnbr = 9999
inv_nbr = 3119
inv__date = 2011-01-01
inv_amt = 150
proj_type = M
pay_month = 01
acctnbr = 9999
inv_nbr = 3119
inv__date = 2011-01-01
inv_amt = 150
proj_type = M
pay_month = 01
acctnbr = 9999
inv_nbr = 3119
inv__date = 2011-01-01
inv_amt = 150
proj_type = M
pay_month = 01
acctnbr = 9999
inv_nbr = 3119
inv__date = 2011-01-01
inv_amt = 150
proj_type = M
pay_month = 01
Each "grouping" is the first record! What am I missing to get this to iterate through the records?
Thanks for your help!