Using php mysql group results by column?
<p>I have a table with data  <code>mobile(id, name, size)</code>;</p>

<pre><code>(1, "Asha 301", "240 x 400");
(2, "Asha 302", "480 x 800");
(3, "Asha 303", "240 x 400");
(4, "Asha 304", "480 x 800");
(5, "Asha 305", "240 x 400");
(6, "Asha 306", "240 x 400");
&lt;?php
    $query = "SELECT id, name, size
              FROM `mobile`
              GROUP BY size Order by display_size ";
    $results = mysql_fetch_array($query);
   foreach ($results as $result) {
        ?&gt;
        &lt;li&gt;
           &lt;?php echo $result['size']; ?&gt;
           &lt;ul&gt;
               &lt;li&gt;&lt;?php echo $result['name']; ?&gt;&lt;/li&gt;
           &lt;/ul&gt;
        &lt;/li&gt;
&lt;?php
}
?&gt;
</code></pre>

<p>And result is:</p>

<pre><code>240 x 400
   Asha 301
400 x 800
   Asha 302
</code></pre>

<p>result only get 1 row, how to get all rows ?</p>

<pre><code>240 x 400
   Asha 301
   Asha 303
   Asha 305
   Asha 306
400 x 800
   Asha 302
   Asha 304
</code></pre>

<p>How to fix it ?</p>
