Note that there are some explanatory texts on larger screens.

plurals
  1. POworking with join query's result
    primarykey
    data
    text
    <p>I have two tables Resources and Categories. I have made a join query and got the result. But I dont know how to work around it. Below is outputted result array. </p> <pre><code>array (size=4) 0 =&gt; array (size=5) 'resourceID' =&gt; string '24' (length=2) 'resourceName' =&gt; string 'Tafe Resources' (length=14) 'categoryID' =&gt; string '3' (length=1) 'categoryName' =&gt; string 'Accounting' (length=10) 'subcategoryID' =&gt; string '0' (length=1) 1 =&gt; array (size=5) 'resourceID' =&gt; string '24' (length=2) 'resourceName' =&gt; string 'Tafe Resources' (length=14) 'categoryID' =&gt; string '4' (length=1) 'categoryName' =&gt; string 'Adult Tertiary' (length=14) 'subcategoryID' =&gt; string '0' (length=1) 2 =&gt; array (size=5) 'resourceID' =&gt; string '26' (length=2) 'resourceName' =&gt; string 'College Resources' (length=17) 'categoryID' =&gt; string '7' (length=1) 'categoryName' =&gt; string 'Automotive' (length=10) 'subcategoryID' =&gt; string '0' (length=1) 3 =&gt; array (size=5) 'resourceID' =&gt; string '26' (length=2) 'resourceName' =&gt; string 'College Resources' (length=17) 'categoryID' =&gt; string '8' (length=1) 'categoryName' =&gt; string 'Busniess &amp; Management' (length=21) 'subcategoryID' =&gt; string '0' (length=1) </code></pre> <p>this was my query </p> <pre><code>$this-&gt;db-&gt;select()-&gt;from('resources'); $this-&gt;db-&gt;join('categories','resources.resourceID = categories.resourceID'); </code></pre> <p>if it was from single table i will use for-each loop and get data. I want the duplicated columns to be merged. I want to display a table where resourceID and resourceName is unique.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload