2014-06-14 57 views
-7

複製如何防止重複記錄從我的表:無景觀下班

<select name="web_site"> 
    <?php 
     $query = $db->query("SELECT * FROM `work`"); 
     while ($row = mysql_fetch_array($query)) { 
      print '<option value="'.$row['id'].'">'.$row['title'].'</option>'; 
     } 
    ?> 
</select> 
+4

請花點時間閱讀:http://stackoverflow.com/help/how-to -ask –

+1

請詳細說明你的問題 – Khushboo

回答

0
$query = $db->query("SELECT * FROM `work` group by title"); 
0
<select name="web_site"> 
    <?php 
     $query = $db->query("SELECT DISTINCT title FROM `work`"); 
     while ($row = mysql_fetch_array($query)) { 
      print '<option value="'.$row['id'].'">'.$row['title'].'</option>'; 
     } 
    ?> 
</select>