Try
(@rows)=$sth-fetchrow_array;
Not
@rows=$sth-fetchrow_array;
José.
-Original Message-
From: Prachi Shah [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 21, 2003 11:06 PM
To: [EMAIL PROTECTED]
Subject: only first checked item passed
Hi all,
I have a CGI script which does a select on a database and builds a checkbox group
iterating through the result of the select. The problem is when a user
submits the form, only the first checked item in the checkbox group is
passed.
Below is the snippet of the perl code that generates the checkbox group.
Please advise me if there is anything I am doing wrong. Any help is
appreciated.
Thanks,
Prachi.
### cut code
if (!$sth) {
$sth = $dbh-prepare(SELECT * FROM . $schema .
dberge_ranges WHERE chrom = ? .
AND start_pt = ? AND stop_pt = ? ORDER BY id, start_pt);
}
$sth-execute($chr, $stp, $st);
my(@row) = $sth-fetchrow_array;
#print @row\n;
if ([EMAIL PROTECTED]) {
print $q-strong(No results and Expression data found\n), $q-br;
}else {
print $q-strong(Experimental results of gene expression), $q-br;
print $q-start_form(-action = $dberge_url);
print $q-br;
print $q-start_table({-border=1}), $q-Tr,
$q-td(ExperimentID Assay),
$q-td(range affected);
my $pid = 0;
while (@row) {
$row[3] = commify($row[3]);
$row[4] = commify($row[4]);
if ($pid == $row[0]) { #same variant another range
if ($row[3] ne $row[4]) {
print $q-br, $row[2] $row[3] - $row[4];
}else {
print $q-br, $row[2] $row[3];
}
}else { #new dberge entry
print $q-Tr;
print $q-td( $q-checkbox(-name='id',
-value=$row[0],
-label=$row[0] $row[1]));
if ($row[3] ne $row[4]) {
print $q-td, $row[2] $row[3] - $row[4]; #may continue
}else {
print $q-td, $row[2] $row[3];
}
}
$pid = $row[0];
@row = $sth-fetchrow_array;
}
print $q-br;
print $q-end_table;
print $q-br;
print $q-hidden(mode, Submit query),
$q-hidden(disp,All data);
print $q-submit(-name=View, -value=Submit);
end cut code ###
_
Chat privately with Bon Jovi, Seal, Bow Wow, or Mary J Blige using MSN
Messenger! http://www5.msnmessenger-download.com/imastar/default.aspx
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
DISCLAIMER
This e-mail and any attachment thereto may contain information which is confidential
and/or protected by intellectual property rights and are intended for the sole use of
the recipient(s) named above.
Any use of the information contained herein (including, but not limited to, total or
partial reproduction, communication or distribution in any form) by other persons than
the designated recipient(s) is prohibited.
If you have received this e-mail in error, please notify the sender either by
telephone or by e-mail and delete the material from any computer.
Thank you for your cooperation.
For further information about Proximus mobile phone services please see our website at
http://www.proximus.be or refer to any Proximus agent.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]