faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

42 of 116 people (36%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

how to delete multiple records using a checkbox

Mar 19th, 2008 21:53
ha mo, John Marc, mark nicholls,


Use this for your checkboxes
<input type="Checkbox" name="deleterecord[]" value="$id">
the [] specifies it to be an array.
Process as follows:
while (list($k,$v) = each($deleterecord)) {
	$sql="delete from table WHERE id=$v";
	$del=mysql_query($sql,$dbh);
}
http://www.tantofa.com
http://www.fantofa.com
http://www.mantofa.com
http://www.tanpola.com
http://www.tampola.com
http://www.yamot.com
http://www.mozmar.com
http://www.templatestemp.com