How to delete multiple rows from mysql database with checkbox using PHP?

后端 未结 4 836
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-16 22:25

I try to delete my data in \"admin\" database, but the delete button does not function.

This is my top part



        
4条回答
  •  走了就别回头了
    2021-01-16 23:20

    try this code. it is working well. connection.php

    
    

    multiple_delete.php

     
     

    Displaying Recods in Table

    id name lastname
    ?>

    delete.php

    
      $your_slected_id) /* for each loop is used to get id and that id is used to delete the record below */ 
                     { 
                     $q="DELETE FROM test_mysql WHERE id=$your_slected_id "; /* Sql query to delete the records whose id is equal to $your_slected_id */
                     mysql_query($q,$conection) ; /* runs the query */ 
    
                     } 
                     header("location:multiple_delete.php"); /* Goes back to index.php */ 
    
                     } 
    
                     } else 
                         { 
                         echo" you have not selected reords .. to delete"; 
    
                         } 
    
                         } ?>
    

提交回复
热议问题