0

how to Deleting multiple rows in datagrid using checkbox

not in gridview .....pls give solution

0

1 Answer 1

1
$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();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.