M
Marc Bissonnette
Sorry for the vague subject line -
I am displaying a table of data from a projects db; Projects that are
active appear on top, with completed tasks appearing on the bottom;
My ( relevant portion of ) code looks like this:
($row[8] is the date completed field, in yyyymmdd - it will only contain 8
digits if it is completed, otherwise NULL for active and '1' for 'on hold')
# ... set up DB query, start loop from DB...
while (@row=$sth->fetchrow()) {
if (length $row[8] == 8) {
$completeddata .= "$row[0]<BR>\n";
} else {
print "$row[0]<BR>\n";
}
}
if ($completeddata) {
print "Completed Items:<BR>\n";
print $completeddata;
}
This code works - it displays everything in the order and in the place
desired, but I'm wondering if the above is a kludge, or really the best way
to accomplish displaying completed items second (other than executing two
separate queries on the DB - Which is equally feasible, but wondering if I
need to do that, or if the above is more efficient)
I am displaying a table of data from a projects db; Projects that are
active appear on top, with completed tasks appearing on the bottom;
My ( relevant portion of ) code looks like this:
($row[8] is the date completed field, in yyyymmdd - it will only contain 8
digits if it is completed, otherwise NULL for active and '1' for 'on hold')
# ... set up DB query, start loop from DB...
while (@row=$sth->fetchrow()) {
if (length $row[8] == 8) {
$completeddata .= "$row[0]<BR>\n";
} else {
print "$row[0]<BR>\n";
}
}
if ($completeddata) {
print "Completed Items:<BR>\n";
print $completeddata;
}
This code works - it displays everything in the order and in the place
desired, but I'm wondering if the above is a kludge, or really the best way
to accomplish displaying completed items second (other than executing two
separate queries on the DB - Which is equally feasible, but wondering if I
need to do that, or if the above is more efficient)