data67 has asked for the wisdom of the Perl Monks concerning the following question:
$SQL_report = "select distinct student_id, student_name, student_address, student_gpa, college from SCHOOL where MINOR = 'CS' ORDER BY student_id"; $sth->execute; while (@row = $sth_report->fetchrow_array) { $student_id = (defined $row[0]) ? $row[0] : ''; $student_name = (defined $row[1]) ? $row[1] : ''; $student_address = (defined $row[2]) ? $row[2] : ''; $student_gpa = (defined $row[3]) ? $row[3] : ''; $college = (defined $row[4]) ? $row[4] : ''; ## Make our html look better if no data. $student_id = " " if ($student_id eq ""); $student_name = " " if ($student_name eq ""); $student_major = " " if ($student_address eq ""); $student_gpa = " " if ($student_gpa eq ""); $college = " " if ($college eq ""); } # End of while
Problem
Everything is working just fine on the DBI side and i can get data which at present
looks something like this.
and is ordered too by id_number. which is exactly what it should be like, BUTid, name, addrss, major, gpa, college id, name, addrss, major, gpa, college id, name, addrss, major, gpa, college id, name, addrss, major, gpa, college
I have tried to use a few different ways using loops but i cant seem to get it to come out right. As always any input will go a long ways....BUSINESS SCHOOL id, name, address, gpa id, name, address, gpa id, name, address, gpa ENGINEERING id, name, address, gpa id, name, address, gpa id, name, address, gpa NURSING id, name, address, gpa id, name, address, gpa id, name, address, gpa
Edit by dws for tag cleanup
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sorting data pullled in by DBI
by dws (Chancellor) on Mar 17, 2002 at 23:59 UTC | |
|
Re: Sorting data pullled in by DBI
by seattlejohn (Deacon) on Mar 17, 2002 at 23:54 UTC | |
|
(jeffa) Re: Sorting data pullled in by DBI
by jeffa (Bishop) on Mar 18, 2002 at 00:32 UTC | |
by blakem (Monsignor) on Mar 18, 2002 at 01:41 UTC | |
by Kanji (Parson) on Mar 18, 2002 at 02:57 UTC | |
by blakem (Monsignor) on Mar 18, 2002 at 03:46 UTC | |
|
Re: Sorting data pullled in by DBI
by cyocum (Curate) on Mar 17, 2002 at 23:55 UTC | |
|
Re: Sorting data pullled in by DBI
by Ryszard (Priest) on Mar 18, 2002 at 00:05 UTC | |
|
Re: Sorting data pullled in by DBI
by data67 (Monk) on Mar 17, 2002 at 23:49 UTC |