我有一张数据表 mobile(id, name, size)
;
(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");
<?php
$query = "SELECT id, name, size
FROM `mobile`
GROUP BY size Order by display_size ";
$results = mysql_fetch_array($query);
foreach ($results as $result) {
?>
<li>
<?php echo $result['size']; ?>
<ul>
<li><?php echo $result['name']; ?></li>
</ul>
</li>
<?php
}
?>
结果是:
240 x 400
Asha 301
400 x 800
Asha 302
结果只得到 1 行,如何获取所有行?
240 x 400
Asha 301
Asha 303
Asha 305
Asha 306
400 x 800
Asha 302
Asha 304
如何解决?