Php 如果列包含使用SQL的特定文本,则行通过/删除至行

Php 如果列包含使用SQL的特定文本,则行通过/删除至行,php,sql,Php,Sql,我需要在“notes”列中包含单词“old”的某些行中添加删除线。 我正在使用连接到sql数据库的php代码。 有没有关于如何做到这一点的示例代码 这是我正在使用的当前代码: <?php $con=mysqli_connect("localhost", "root", "") or die("Error connecting to database: ".$mysqli->error); mysqli_select_db($con, 'mysql') or die(mysqli_

我需要在“notes”列中包含单词“old”的某些行中添加删除线。 我正在使用连接到sql数据库的php代码。 有没有关于如何做到这一点的示例代码

这是我正在使用的当前代码:

<?php

$con=mysqli_connect("localhost", "root", "") or die("Error connecting to database: ".$mysqli->error);

mysqli_select_db($con, 'mysql') or die(mysqli_error($con));
$result= $con->query("SELECT * FROM `cloud_team` WHERE `Vendor` = 'cisco' ORDER BY `customer_name` DESC") or die($mysqli->error);;

echo "<table align='center' border='3' cellspacing='1' cellpadding='1'>";

echo "<thead><th style='background-color:#00ffff'>customer number</th><th style='background-color:#00ffff'>customer name</th><th style='background-color:#00ffff'>Platform</th><th style='background-color:#00ffff'>MGMT IP</th><th style='background-color:#00ffff'>Current Version</th><th style='background-color:#00ffff'>Recommended Version</th><th style='background-color:#00ffff'>Last Version</th><th style='background-color:#00ffff'>GUI User</th><th style='background-color:#00ffff'>Serial</th><th style='background-color:#00ffff'>date</th><th style='background-color:#00ffff'>Notes</th></thead>";

$i=1;

while($row = mysqli_fetch_assoc($result)) {

if($i%2==0)
{
    echo '<tr bgcolor="#FFFF00">';
}
else
{
    echo '<tr bgcolor="#99FFCC">';
}
    $i++;

echo "<a ='send.php'>" . "<td> " . $row['customer_number'] . "<td> " . $row['customer_name'] . "<td> " . $row['Platform'] . " <td> " . $row['MGMT_IP'] . " <td> " . $row['Version'] . " <td> " . $row['recommended_version'] . " <td> " . $row['last_version'] . " <td> " . $row['GUI_User'] . "<td> " . $row['serial'] . "<td> "  . $row['Service_contract'] . "<td> " .$row['Notes']. "</a></td>";

echo "<td><a href='/cloudpass/viewpass.php?id=".$row['ID']."' target=\"_blank\"  class='btn btn-warning btn-sm'>View Password</a></td>";

echo "</tr>";
}
echo "</table>";
$con->close;
?>

首先,为删除线设置CSS类:

<style>
.old-row {
    text-decoration: line-through;
}
</style>
最后,将该类添加到输出的每一行:

if($i%2==0)
{
    echo "<tr bgcolor='#FFFF00' class='$add_strikethrough'>";
}
else
{
    echo "<tr bgcolor='#99FFCC' class='$add_strikethrough'>";
}
if($i%2==0)
{
回声“;
}
其他的
{
回声“;
}

您编写了什么代码?哪里有问题?我只想在代码中添加一些新内容。这没有问题:)我需要一个代码示例来执行以下操作:如果在“Notes”列中找到“Old”一词,那么在该行中添加一个删除线。其目的不是删除这些行,而是在这些行中添加删除线/换行符。这不是代码编写服务。请阅读并显示相关的代码。编辑后,我希望现在你不认为它是一个写作服务。
if($i%2==0)
{
    echo "<tr bgcolor='#FFFF00' class='$add_strikethrough'>";
}
else
{
    echo "<tr bgcolor='#99FFCC' class='$add_strikethrough'>";
}