[eluser]sniperscope[/eluser]
I solved my problem.
I am posting solution and hope it might help to someone else too.
Code:
class Model_System extends CI_Model
{
function Category()
{
$dsp = "";
$sql = "SELECT price_id, price_name, price_remark FROM price_master ORDER BY price_id ASC";
$query = $this->db->query($sql);
if($query->num_rows > 0)
{
$row = $query->result_array();
foreach($row as $row)
{
$dsp .= '
<table class="system">
<tr><td colspan="2" class="tdTitle">' .$row['price_name']. '</td></tr>';
$sub_category = "SELECT price_child_title, price_child_price FROM price_child WHERE price_master_id = '" .$row['price_id']. "' ORDER BY price_child_id DESC";
$sub_category = $this->db->query($sub_category);
if($sub_category->num_rows > 0)
{
$sub = $sub_category->result_array();
foreach($sub as $sub)
{
$dsp .= '
<tr><th>' .$sub['price_child_title']. '</th><td>' .$sub['price_child_price']. '円</td></tr>';
}
}
$dsp .= '
<tr><td colspan="2" class="tdBiko">' .$row['price_remark']. '</td></tr>
</table>';
}
}
$query->free_result();
return $dsp;
}