我有商业名录,希望它能够把Craigslist等所有员额归为一类。
我的现有数据将如上所示现场。
<business name1> <phone number> <jan 13 2012>
<business name2> <phone number> <jan 13 2012>
<business name1> <phone number> <jan 12 2012>
我希望这样作,那么这些员额将在公布日期之前分组。
<jan 13 2012>
<business name1> <phone number>
<business name2> <phone number>
<jan 12 2012>
<business name1> <phone number>
<business name2> <phone number>
这里我的发言
connection
$query = "SELECT * FROM `myname` ORDER BY `myname`.`id` DESC LIMIT $offset, $limit ";
$result = mysql_query($query);
while($row = mysql_fetch_row($result))
{
?>
<div class="list">
<div class="ads_name"><a href="http://www.mydomain.com/category/<?=$row[0]?>.html" target="_blank"><?=$row[4]?> </a></div>
<div class="location"><?= htmlspecialchars($row[5])?></div>
<div class="phone"><?=formatPhoneNumber($row[3])?></div>
<div class="date"><?=$row[9]?></div>
</div>
<?php
}
mysql_free_result($result);
?>