hi guys
i need to sort an array of products that has another array of categories inside,
something like
now i have to sort this $prod array by categories without making a new sql query, how do i do that?
i need to sort an array of products that has another array of categories inside,
something like
$prod = array();
$data = array();
$cat = array();
$n = 0;
// $qr is a returned sql query response
while($ln = mysql_fetch_array($qr))
{
$data['id'] = $ln['product_id'];
$data['name'] = $ln['product_name'];
$data['cat'] = $ln['product_category'];
$prod[$n] = $data;
$n++;
}
return $prod;
now i have to sort this $prod array by categories without making a new sql query, how do i do that?