2016-06-09 96 views
-2

你好,我只是創建我的支持系統,我也得到迴音票detalis但它顯示所有的TD線圖片我需要只顯示第一行PHP的幫助刪除刪除TD線

Need to remove lines with red

我代碼

<table cellpadding="0" cellspacing="0" border="0" class="data"> 
<thead> 
<tr> 
    <th width="115"><p2>Ticket ID</p2></th> 
    <th width="90"><p2>Status</p2></th> 
    <th width="160"><p2>Ticket Topic</p2></th> 
    <th width="160"><p2>Client</p2></th> 
</tr> 
</thead> 
<tr> <?php 
      echo "<td><a href='?page=ticket&id=".$row[id]."'</a>#".$row[id]."</td>"; 
      echo "<td>".$row[status]."</td>"; 
      echo "<td>".$row[naslov]."</td>"; 
      $userr = mysql_query('SELECT * FROM client WHERE clientid='.$row["user_id"].''); 
      $useri = mysql_fetch_array($userr);  
      echo "<td><a href='clientsummary.php?id=".$row[user_id]."'</a>".$useri['firstname']." ".$useri['lastname']."</td>"; 
     ?> 
</tr>  

+0

**然後,它需要相當多的或重寫**切勿使用[了'mysql_'數據庫擴展] (http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php), 已被棄用(在PHP7中永遠消失)特別是如果你只是學習PHP,花費你的精力在學習'PDO'數據庫擴展。 [從這裏開始](http://php.net/manual/en/book.pdo.php)它真的很容易 – RiggsFolly

+0

不要*「滾動你自己的」*呃? @RiggsFolly我自己通常喜歡知道什麼是「在那裏」以及「被帶入」什麼。 ;-)編輯:啊,你編輯過,已經失去了所有的意義。 –

+1

這是整個代碼塊包裝在一個循環?將表格標題移動到循環之外。 –

回答

1

你需要將你的表頭外循環。沒有看到循環的機制,我猜這將需要類似於此:

<table cellpadding="0" cellspacing="0" border="0" class="data"> 
<thead> 
<tr> 
    <th width="115"><p2>Ticket ID</p2></th> 
    <th width="90"><p2>Status</p2></th> 
    <th width="160"><p2>Ticket Topic</p2></th> 
    <th width="160"><p2>Client</p2></th> 
</tr> 
</thead> 
<tbody> 

<?php include 'missing.query.on.other.script.php'; 

while ($row = mysql_fetch_array($whatever_resource)){ 

?> 



<tr> <?php 
      echo "<td><a href='?page=ticket&id=".$row[id]."'</a>#".$row[id]."</td>"; 
      echo "<td>".$row[status]."</td>"; 
      echo "<td>".$row[naslov]."</td>"; 
      $userr = mysql_query('SELECT * FROM client WHERE clientid='.$row["user_id"].''); 
      $useri = mysql_fetch_array($userr);  
      echo "<td><a href='clientsummary.php?id=".$row[user_id]."'</a>".$useri['firstname']." ".$useri['lastname']."</td>"; 
     ?> 
</tr> 

<?php } // end while ?> 

</tbody> 
</table>