2019-04-21 17:02


  • php
  • html

I have a page which connects to the database and gets some data including title and content.
I use a while loop to echo the data inside this page, what I'm trying to do is to have 2 buttons under every result that comes from database which is the "Edit" and "Delete" buttons. The problem is I don't know how to make buttons remove or edit the right column.
Added the PHP part:

$sql = "SELECT * FROM posts ORDER BY date DESC, time DESC $limit";
$query = mysqli_query($conn, $sql);
while ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) {
        <b>Title: </b>
        <p><?php echo $row['name'] ?></p><br>
        <b>Content: </b><br>
        <p><?php echo $row['content'] ?></p><br>
//want to have two buttons here which can be used to edit or delete the colunm that they are under it
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享