Deleting row of selected checkbox


mutak87

This code is used to delete row of selected checkbox. If user want to delete all rows, they have to ‘select all’ button first before deleting its. Or they can delete certain rows based on their selection.

Below is the full code.

<?php //to solve Cannot modify header information ob_start(); ?> <?php //create a database connection mysql_connect("localhost", "root","") or die(mysql_error()); //select your database mysql_select_db("test"); ?> <html> <head>  function do_this(){ var checkboxes = document.getElementsByName('checkbox[]'); var button = document.getElementById('toggle'); if(button.value == 'select'){ for (var i in checkboxes){ checkboxes[i].checked = 'FALSE'; } button.value = 'deselect' }else{ for (var i in checkboxes){ checkboxes[i].checked = ''; } button.value = 'select'; } }  </head> <body background="schoolbackground.jpg"> 
Student List
<p> </p> <p align="center"> <?php $query = mysql_query("SELECT * from test"); $count = mysql_num_rows($query); ?> <table frame="border" rules="all" cellpadding="5" bgcolor="#FFFFFF"> <tr> <th></th> <form name="form1"…

View original post 117 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s