Php Html<;A>;链接变量

Php Html<;A>;链接变量,php,html,mysql,phpmyadmin,Php,Html,Mysql,Phpmyadmin,我正在尝试这样做: <?php while($row = mysqli_fetch_assoc($result)) { ?> <li><?php echo $row["msg"] ;?>(id: <?php echo $row["msg_id"] ;?>) | sent at <?php echo $row["data"] ;?> <a href="message.php">see</a> | <

我正在尝试这样做:

 <?php while($row = mysqli_fetch_assoc($result)) { ?>

    <li><?php echo $row["msg"] ;?>(id: <?php echo $row["msg_id"] ;?>) | sent at <?php echo $row["data"] ;?> <a href="message.php">see</a> | <a href="delete.php?msg_id=<?php $row["msg_id"]?>">delete</a></li>

 <?php 

    }
 ?>

  • (id:)|发送地址|
  • 但它不起作用。msg_id正确,db信息良好,但我不知道如何使url像
    delete.php?msg_id=$ROW_msg_id
    。 也许你能帮我。谢谢

    
    
    <?php
    /* This code is a little bit hard to read.  
    It would be much easier to troubleshoot if it is cleaner.  
    Besides that, the problem could be your message.php or delete.php.  
    This code is actually fine by itself. */?>
    
    
    <li>
        <?php
            echo $row['msg'].'(id: '.$row['msg_id'].') | sent at '.$row['data'];
            echo '<a href="message.php">see</a> | '.
                 '<a href="delete.php?msg_id='.$row['msg_id'].'">delete</a>';
    
        ?>
    
    </li>
    
    <?php
    /* Output:
           * message(id: message_id) | sent at row_data see | delete.
    
    
    // [link]see[/link to message.php] | [link]delete[/link to delete.php]
    
    */?>
    

  • 您只是在
    中的
    $row[“msg_id”]
    之前缺少了
    echo
    。“你在电话里的其他时候都做得很好。@Barmar哦,谢谢你,兄弟。”。我不小心。非常感谢,你可以用
    试试
    的简写法,只需一点建议。小心,通过http get进行删除可能会很危险。浏览器可以预取并将您的项目发送到bit bucket!谢谢你的回答,但是我发现了问题,我忘记了“回声”。我想做delete.php?myvariable=12040