通过php表调用值后如何隐藏它

a64a0gku  于 2021-06-17  发布在  Mysql
关注(0)|答案(1)|浏览(224)

关闭。这个问题需要细节或清晰。它目前不接受答案。
**想改进这个问题吗?**通过编辑这个帖子来添加细节并澄清问题。

两年前关门了。
改进这个问题
嘿,我想隐藏一个我正在调用的值。。它的id值是。$row[“item\u id”]。。我怎样才能做到这一点?

$query = "SELECT * from itemtbl where username = '{$_SESSION['username']}'";
$result = mysqli_query($con,$query);
if ($result->num_rows > 0) 
{
    while($row = $result->fetch_assoc()) 
    {

        echo "<tr><td>" . $row["item_name"]. "</td><td>" . $row["description"] . "</td><td>"
        . $row["item_pic"]. "</td><td>" . $row["item_id"]. "</td><td>";

        echo '<a href="studentinventoryedit.php?item_name='.$row['item_name'].'"><button title="edit" type="button" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-pencil white"></span></button></a>';
        echo '<a href="studentinventoryedit.php"><button title="delete"type="button" class="btn btn-default btn-sr"><span class="glyphicon glyphicon-trash white"></span></button></a>';
    }

} else { 
    echo  "</table>"; 
    echo  '<p class="a1"><b>You have no item. Please insert item</p>'; 
}
ldioqlga

ldioqlga1#

您可以将该值赋给隐藏元素或tr row id属性,而不是将其放在td中。

<td><input type='hidden' value='" . $row["item_id"]. "' /></td>

另外,用tr而不是td关闭回声

相关问题