2016-06-09 98 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>