• 增删改查-删除(php)


    <!DOCTYPE html>

    <html>
    <script type="text/javascript" src="jquery-1.11.3.min.js"></script>
    <style type="text/css">
    table.imagetable {
    font-family: verdana,arial,sans-serif;
    font-size:11px;
    color:#333333;
    border- 1px;
    border-color: #999999;
    border-collapse: collapse;
    }
    table.imagetable th {
    background:#b5cfd2 url('cell-blue.jpg');
    border- 1px;
    padding: 8px;
    border-style: solid;
    border-color: #999999;
    }
    table.imagetable td {
    background:#dcddc0 url('cell-grey.jpg');
    border- 1px;
    padding: 8px;
    border-style: solid;
    border-color: #999999;
    }
    </style>
    <script type="text/javascript">
    function dele($id){
    var id=$id;
    if(id){
    $.get("delete.php",{'id':id},function(data){
    if(data==200){alert("1");
    window.location.href=window.location.href;
    }
    else{
    alert("2");
    }
    });
    }

    }
    </script>
    <body>
    <table class="imagetable">
    <tr>
    <th>id</th><th>name</th><th>pwd</th><th>sex</th><th>class1</th><th>tel</th><th>操作</th>
    </tr>
    <?php
    header( 'Content-Type:text/html;charset=utf-8 ');
    include_once("conn/conn.php");

    $sql="select * from user ";
    $r=mysqli_query($link,$sql);
    $row=mysqli_fetch_array($r);


    while ($row=mysqli_fetch_array($r)) {
    ?>

    <tr>
    <td><?php echo $row["id"] ?></td>
    <td><?php echo $row["name"] ?></td>
    <td><?php echo $row["pwd"] ?></td>
    <td><?php echo $row["sex"] ?></td>
    <td><?php echo $row["class1"] ?></td>
    <td><?php echo $row["tel"] ?></td>

    <td><a href="" onclick="dele(<?php echo $row["id"] ?>);">删除</a></td>
    </tr>
    <?php
    }
    ?>
    </body>

    </html>

  • 相关阅读:
    717. 1比特与2比特字符
    697. 数组的度
    674. 最长连续递增序列
    665. 非递减数列
    661. 图片平滑器
    643. 子数组最大平均数 I
    plink计算两个SNP位点的连锁不平衡值(LD)
    GWAS群体分层校正,该选用多少个PCA
    PyCharm的安装和应用
    GWAS后续分析:多基因风险评分(Polygenic Risk Score)的计算
  • 原文地址:https://www.cnblogs.com/lichangqing1997/p/7911856.html
Copyright © 2020-2023  润新知