$runrwos = array();
for ($i = 0; $runrwos= mysql_fetch_assoc($run); $i++)
{
$DD_E_SC[$i]=$runrwos['DD_E_SC'];
$DD_E_pKW[$i]=$runrwos['DD_E_pKW'];
$DD_G_SC[$i]=$runrwos['DD_G_SC'];
$DD_G_pKW[$i]=$runrwos['DD_G_pKW'];
$data[$i] = array('DD_E_SC'=>$runrwos['DD_E_SC'],'DD_E_pKW'=>$runrwos['DD_E_pKW'], 'DD_G_SC'=>$runrwos['DD_G_SC'], 'DD_G_pKW'=>$runrwos['DD_G_pKW']);
foreach ($data as $entry)
{
$Ep =($entry['DD_E_SC']*365+$entry['DD_E_pKW']*$SE_cons )/100;
$Gp =($entry['DD_G_SC']*365+$entry['DD_G_pKW']*$SG_cons )/100;
$Tp=$Ep+$Gp;
}
}
I have the above code that get row data from a database, once data are retrieved and stored into an array give the expected result. This code work fine, but output result as retrieved from database. My problem is when I sort the data by $Tp or $Ep or $Gp. I need to sort by descendant or ascendant value. Any help Thanks