如何删除会破坏特定php值的表行?
我想将文本装饰应用到一个表行,该行将根据mysql查询循环。我只想在变量的值不感兴趣的情况下删除该行 在下面的循环中,有一个id为line的表行。还有一个变量$status。我希望tabel行被删除,如果$status的值是“不感兴趣”,我怎么做如何删除会破坏特定php值的表行?,php,html,Php,Html,我想将文本装饰应用到一个表行,该行将根据mysql查询循环。我只想在变量的值不感兴趣的情况下删除该行 在下面的循环中,有一个id为line的表行。还有一个变量$status。我希望tabel行被删除,如果$status的值是“不感兴趣”,我怎么做 while ($prow=mysql_fetch_object($productname)) { $pname.=$prow->name.'<br />'; } $
while ($prow=mysql_fetch_object($productname))
{
$pname.=$prow->name.'<br />';
}
$staffname=mysql_query("select name from staff where sid='$assignedto' or flag='$assignedto'");
if(mysql_num_rows($staffname) > 1)
{
echo "<tr id='line'";
if($count %2==0)
echo "bgcolor='white' style='height:10px;'";
echo ">";
$count++;
?>
<td>
<span class="time"><a title="<?echo $added;?>" ></a></span>
</td>
<?
echo "<td >".$name. "</td>";
echo "<td>".$status."</td>";
echo "<td >".$phone." "."|"." ".$mobile. "</td>";
// echo "<td >".$email. "</td>";
echo "<td >".$city. "</td>";
echo "<td >".$pname. "</td>";
echo "<td >".$sname. "</td>";
echo "<td >".$lastactivity. "</td>";
?>
</table>
while($prow=mysql\u fetch\u object($productname))
{
$pname.=$prow->name.“
”;
}
$staffname=mysql_查询(“从职员中选择名称,其中sid='$assignedto'或flag='$assignedto'”);
如果(mysql_num_rows($staffname)>1)
{
回声“;
$count++;
?>
大概是这样的:
if ($status == 'Not Interested') { $strike = 'text-decoration:line-through'; }
else { $strike = ''; }
tr.line-through td{
text-decoration:line-through
}
然后
echo "<tr id='line'";
if($count %2==0)
echo "bgcolor='white' style='height:10px; $strike'";
echo ">";
echo”“;
如果$status不是“不感兴趣”
,它将简单地添加'
,而不是文本装饰:行通过如下:
if ($status == 'Not Interested') { $strike = 'text-decoration:line-through'; }
else { $strike = ''; }
tr.line-through td{
text-decoration:line-through
}
然后
echo "<tr id='line'";
if($count %2==0)
echo "bgcolor='white' style='height:10px; $strike'";
echo ">";
echo”“;
如果$status不是“不感兴趣”
,它将简单地添加”
,而不是文本装饰:在循环中,您可以检查$status的值,如果它匹配“不感兴趣”,您只需添加一个特定的CSS类(例如:class=“line through”)到该行,然后在CSS中处理其余部分,如下所示:
if ($status == 'Not Interested') { $strike = 'text-decoration:line-through'; }
else { $strike = ''; }
tr.line-through td{
text-decoration:line-through
}
在循环中,您可以检查$status的值,如果它与“Not Interest”匹配,您只需向该行添加一个特定的CSS类(例如:class=“line-through”),然后在CSS中处理其余的内容,如下所示:
if ($status == 'Not Interested') { $strike = 'text-decoration:line-through'; }
else { $strike = ''; }
tr.line-through td{
text-decoration:line-through
}