[eluser]phpbeginner[/eluser]
I'm just started programming and having problem in displaying my result in correct format.
code from model :
Code:
function compare($val)
{
$id=$val;
$this->db->select('pf.availability AS feature');
$this->db->from('product_master pm');
$this->db->join('product_feature pf', 'pf.product_id = pm.product_id');
$this->db->where_in('pm.product_id', $id);
$this->db->where_in('Select feature_id from feature');
$query = $this->db->get() or die(mysql_error());
return $query->result();
}
this i call through controller
Code:
$temp = array('cmp'=> $this->user_model->compare($checkbox));
$this->load->view('compare',$temp);
All this is fine.. I wan to display the result in array all availability of one product in 1 column and 2nd product feature availability in nd column . Same as you see in mobile store website when u compare 2 cellphone.
Code:
<?php foreach($cmp as $item ):?>
<tr></tr>
<td><?php echo $item->feature;?></td>
</tr>
<?php
endforeach; ?>
</table>
using this ,but everything is being displayed in same column.
please advice how to arrange in proper format.