in reply to Re: Explain SQL statement
in thread Explain SQL statement
foreach $key_pal (sort keys %pal) { $sql ="SELECT * FROM app_admin WHERE day = '$d' AND month = '$m_num' A +ND year = '$y' AND NUMALL IN (".join(',',keys %pal).") AND status= '2 +' "; if($order == 2 ) { $sql .= " ORDER BY c_name"; } elsif ($order == 3 ) { $sql .= " ORDER BY NUMALL"; } $sth = $dbh->prepare($sql); foreach my $key_expal (keys %expal) { $sth->execute($key_expal) || die $sth->errstr; while ($pointer = $sth->fetchrow_hashref) { my $expalnum = $pointer->{'expal'}; my $comp = $pointer->{'c_name'}; my $cltime = $pointer->{'time'}; my $cltime2 = $pointer->{'time2'}; my $last_name = $pointer->{'last_name'}; my $clnum = $pointer->{'c_number'}; my $status = $pointer->{'status'}; print "<br>L 265 - <b>$comp</b> $expalnum"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Explain SQL statement
by hardburn (Abbot) on May 26, 2004 at 14:00 UTC | |
|
Re^3: Explain SQL statement
by herveus (Prior) on May 26, 2004 at 13:58 UTC | |
by Anonymous Monk on May 26, 2004 at 14:06 UTC | |
by herveus (Prior) on May 26, 2004 at 14:08 UTC | |
by Anonymous Monk on May 26, 2004 at 14:58 UTC | |
by Anonymous Monk on May 26, 2004 at 14:29 UTC | |
|
Re^3: Explain SQL statement
by Roy Johnson (Monsignor) on May 26, 2004 at 14:35 UTC |