0

hello,, i am a newbe in php can any one tell me how to delete multiple records in php , i am using dreamweaver as my front end tool and php triad for the back end .......


i want to learn how can i delete multiple records by passing the value of record id in my php query .... Plz help !:rolleyes:

3
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by php_daemon
0

hello,, i am a newbe in php can any one tell me how to delete multiple records in php , i am using dreamweaver as my front end tool and php triad for the back end .......


i want to learn how can i delete multiple records by passing the value of record id in my php query .... Plz help !:rolleyes:

What database are you using? And what you use to develop the program won't matter in the answer :)

0

Here's the basic idea:

.....
<input type="checkbox" name="id[]" value="1'/>
<input type="checkbox" name="id[]" value="2'/>
<input type="checkbox" name="id[]" value="3'/>
.....
$ids="";
foreach($_POST['id'] as $id) $ids.=((int)$id).",";
$ids=substr($ids,0,-1);

$query="DELETE FROM t1 WHERE id IN ($ids)";
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.