2016-08-20 60 views
-1

您好,我想從表中獲取不同的列數據。 我的代碼如下。 我怎樣才能讓季節欄目獨特?我想從表中區分出特定的列

<div class="episodes"> 
    <?php 
    $name=$_GET['name']; 
    $select=mysql_query("select * from data where name='$name'"); 
    while($show=mysql_fetch_array($select)) 
    { ?> 
     <div class="episodes_data"> 
      <div class="t_s_pic"> 
       <a href="#" style="text-decoration:none;"><img src="admin/photo/movieForsaken-2016-movie-Justin-Price-6-355x500.jpg" height="100%" width="100%"/></a> 
      </div> 
      <div class="t_s_name"><h3><a href="">Game Of Thrones<br/>season<?php echo $show['season'];?></a></h3></div> 
      <div class="t_s_download"><a href="">Download series</a></div> 
     </div> 
    <?php } ?> 
</div><br> 
+0

給我們一些更多的細節,並顯示您所需的輸出。做一個截圖,盡一切可能來解釋清楚。 –

回答

0

爲獲得不同的欄,你不應該使用select *通過explicitally選擇列,你需要如:

select distinct column1, column2, column3 from data where name='$name' 
相關問題