Web Hosting Talk







View Full Version : Another sort results question


praxedis
07-28-2005, 04:29 PM
I have some records from a MySQL database I'm pulling like:

foreach($submissions_pages as $submit => $submission)
{
echo $submission
}

Well, $submission has a $submission[process_id].

Any particular submission can have multiple process_ids - 10, 11, and 12. They're sequential so if there's a record with an 11, the record also has to have a 10 but not a 12. If the record has a 12, then the record also has an 11 and 10.

I want to filter the results so that 10s show up if there is no 11 or 12 associated with the record. 11s show if there's no 12, but there is a 10. 12s show even when there is a 10 and 11 associated with it sort of like the DISTINCT method in MySQL.

Any help appreciated.

praxedis
07-28-2005, 05:30 PM
Here's another example of what I'm trying to do, but this logic is obviously not working.


foreach($submissions_pages as $submit => $submission)
{

$aryBrokerProcessDetails = dhd_fn_fp_submission_process_details_get($submission_id);
if(array_key_exists(12,$aryBrokerProcessDetails))
{
echo $submission."12";
continue;
}
if(array_key_exists(11,$aryBrokerProcessDetails))
{
echo $submission."11";
continue;
}
if(array_key_exists(10,$aryBrokerProcessDetails))
{
echo $submission."10";
continue;
}
}