$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
In reply to Sorting data pulled in by DBI by data67
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |