I need to display these database elements alphabetically (by Title), but the order is predetermined because they are chosen by a loop inside a loop. Any advice? This is what my code looks like:
/* list all SubApps */
$query = "select * from tbAppLSubApp where fkApp = '$fkApp'";
$mysql_result = mysql_query($query, $mysql_link);
while ($tbAppLSubApp = mysql_fetch_object($mysql_result)){
$fkSubApp = $tbAppLSubApp->fkSubApp;
/* get chosen SubApp */
$k_query = "select * from tbSubApp where pkSubApp = '$fkSubApp' order by Title";
$k_query_result = mysql_query($k_query, $mysql_link);
$k = mysql_fetch_object($k_query_result);
$pkSubApp = $k->pkSubApp;
$Title = stripslashes($k->Title);
$Description = stripslashes($k->Description);
print "$Title\n";
/* list all SubApps */
$query = "select * from tbAppLSubApp where fkApp = '$fkApp'";
$mysql_result = mysql_query($query, $mysql_link);
while ($tbAppLSubApp = mysql_fetch_object($mysql_result)){
$fkSubApp = $tbAppLSubApp->fkSubApp;
/* get chosen SubApp */
$k_query = "select * from tbSubApp where pkSubApp = '$fkSubApp' order by Title";
$k_query_result = mysql_query($k_query, $mysql_link);
$k = mysql_fetch_object($k_query_result);
$pkSubApp = $k->pkSubApp;
$Title = stripslashes($k->Title);
$Description = stripslashes($k->Description);
print "$Title\n";