从列中选择唯一值
我有一个MySQL表,其中包含以下类型的信息: Date product 2011-12-12 azd 2011-12-12 yxm 2011-12-10 sdx 2011-12-10 ssdd 这是我用来从该表获取数据的脚本示例: <?php $con = mysql_connect("localhost","username","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("db", $con); $sql=mysql_query("SELECT * FROM buy ORDER BY Date"); while($row = mysql_fetch_array($sql)) { echo "<li><a href='http://www.website/". $row['Date'].".html'>buy ". date("j, M Y", strtotime($row["Date"]))."</a></li>"; } mysql_close($con); …