checkboxDelete multiple items

WBOY
Release: 2016-07-25 09:10:02
Original
886 people have browsed it
  • {
  • }
  • $link=mysql_connect("localhost","root","");
  • 复制代码
  • ?>
  • ?>
  • delete.php
  • mysql_select_db("dbname");
  • $id=$_POST['select']; //调用input的name
  • foreach($id as $ide){
  • $exec="delete from tablename where sID=$ide";
  • $result=mysql_query($exec);
  • if((mysql_affected_rows()==0) or (mysql_affected_rows==-1))
  • {
  • echo "没有找到记录,或者删除时出错";
  • exit;
  • }
  • else{
  • echo "学生信息已经删除";
  • }
  • }
  • mysql_close();
  • ?>
    ID Name
  • //这里的name很重要,到delete.php中会调用


  • Related labels:
    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!