how can i join the two arrays from controller
<p>How can I join the two arrays from controller? I tried to use <code>AND</code> operator as shown below but I failed. How can I make it possible?</p>

<pre><code>function view_product($category_id)
{
    $category_id=$this-&gt;uri-&gt;segment(3);
    $this-&gt;load-&gt;model('select');
    $this-&gt;data["products"]=$this-&gt;select-&gt;get_products($category_id);
    $this-&gt;data["prices"]=$this-&gt;select-&gt;get_price($category_id);
    $this-&gt;load-&gt;view("header");
    $this-&gt;load-&gt;view("products",
    $this-&gt;data);
}
</code></pre>

<p>here is my view:</p>

<pre><code>&lt;?php
$n=0;
foreach(($products as $product) &amp;&amp; ($prices as $price) ) {
    $n++;
    echo '&lt;tr&gt;&lt;td&gt;' .$n .'&lt;/td&gt;&lt;td&gt;'.$product['product_id'].'&lt;/a&gt;&lt;/td&gt;
          &lt;td&gt;'.$product['product_name'].'&lt;/td&gt;&lt;td&gt;'.$product['product_description'].'&lt;/td&gt;&lt;td&gt;'.$price['price_per_unit'].'&lt;/td&gt;&lt;td&gt;'.$price['price_per_item'].'&lt;/td&gt;&lt;/tr&gt;';
}
echo '&lt;/table&gt;';        
?&gt;
</code></pre>

<p>My model</p>

<pre><code>function get_products($category_id)
{
    $this-&gt;db-&gt;select('*');
    $this-&gt;db-&gt;from('categories c');
    $this-&gt;db-&gt;join('products p', 'c.category_id=p.category_id', 'left');
    $this-&gt;db-&gt;where('c.category_status = 0');
    $this-&gt;db-&gt;where('c.category_id', $category_id); 
    $query = $this-&gt;db-&gt;get();
    return $query-&gt;result_array();
}

function get_price($category_id)
{
    $this-&gt;db-&gt;select('*');
    $this-&gt;db-&gt;from('categories c');
    $this-&gt;db-&gt;join('price r', 'c.category_id=r.category_id', 'c.product_id=r.product_id', 'left');
    $this-&gt;db-&gt;where('c.category_status = 0');
    $this-&gt;db-&gt;where('c.category_id', $category_id); 
    $query = $this-&gt;db-&gt;get();  
    return $query-&gt;result_array();
}
</code></pre>

<p>How can i join the two arrays from controller?</p>