tags:

views:

766

answers:

2

how to Deleting multiple rows in datagrid using checkbox

not in gridview .....pls give solution

A: 

Have you check this tutorial Selecting, Confirming & Deleting Multiple Checkbox Items In A DataGrid?

RioTera
Ya i saw but i used dynamic row genegated when i pressed tab key....in 3 tired architecture
Domnic
I don't understand what it means "when I pressed tab key" and a 3 tired architecture is not a software
RioTera
suppose consider in datagrid i have two text box when i fill records to it then i ill press tab key then another row automatically generated so how can i delete multiple rows using checkbox in datagrid not in gridview
Domnic
A: 

$action = $_GET["action"]; if($action == "delete") { $usersToDelete = ""; foreach ($_REQUEST['checkbox'] as $id) { if($usersToDelete == "") { $usersToDelete = "'" . $id . "'"; } else { $usersToDelete = $usersToDelete . ",'" . $id . "'"; } } $sql = "DELETE FROM table_name WHERE id in ($usersToDelete)";

    mysql_query($sql) or die('Error: ' . mysql_error());

} ob_end_flush();

geek