I have the following query that pulls the following column data(studentid, studentclassification, advisorid) from a mySQL table named advisor.
data example
1324,freshman,434
$sql = "select * from advisor";
$result = mysql_query($sql) or die ("Ack! Query failed!");
The student data I need to sort on (lastname) does not live within the mySQL table, but rather within an Oracle database. I take the student id which is in the mySQL database and run it through a function that looks up the student info and grabs the firstname, lastname, email, etc.
while($query_data = mysql_fetch_array($result))
{
$stid = $query_data["studentid"];
//query oracle to get student information
OracleLogin();
GetOracleInfoTest($stid);
echo $oracle_first_name, $oracle_mi, $oracle_last_name, $oracle_email_address, $classification."<br />";
}
On one page, I list a professor and all the students that are assigned to them. The issue is that I cannot sort the list by lastname since I do not grab that information until I iterate each time through the loop against the mySQL database. Does it make sense to feed the while loop to a multidimensional array that sort after the fact? Any suggestions relating to how to approach/solve this issue?
Thanks!