I got this code:

    //mysql connection
    $dbconn = mysql_connect("localhost","root","password") or die();
    mysql_select_db("imaccs_v1") or die();
    $sqlquery = "SELECT * FROM clerks"; // query on table
    $sqlresult = mysql_query($sqlquery, $dbconn);
    $count = mysql_num_rows($sqlresult); // count query result
    <table width="400" border="1" cellspacing="1" cellpadding="0">
    <tr><td>  <form method="post" action="delete5.php">
    <table width="400" border="1" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"><tr>
    <td bgcolor="#FFFFFF"> </td>
    <td colspan="4" bgcolor="#FFFFFF"><strong>Delete multiple rows in mysql</strong> </td></tr>
    <tr><td align="center" bgcolor="#FFFFFF">#</td>
    <td align="center" bgcolor="#FFFFFF"><strong>Id</strong></td>
    <td align="center" bgcolor="#FFFFFF"><strong>Name</strong></td>
    <td align="center" bgcolor="#FFFFFF"><strong>Lastname</strong></td>
    <td align="center" bgcolor="#FFFFFF"><strong>Email</strong></td></tr>
    <?php while($rows = mysql_fetch_assoc($sqlresult)){ ?>
    <tr><td align="center" bgcolor="#FFFFFF">
    <input type="checkbox" name="checkbox[]" id="checkbox[]" value="<?php echo $row['id']?>" />
    </td><td bgcolor="#FFFFFF"><?php echo $rows['id']; ?></td>
    <td bgcolor="#FFFFFF"><?php echo $rows['fname']; ?></td><td bgcolor="#FFFFFF"><?php echo $rows

['lname']; ?>
    </td><td bgcolor="#FFFFFF"><?php echo $rows['email']; ?>
    <?php } ?>
    <tr><td colspan="5" align="center" bgcolor="#FFFFFF">
    <input name="delete" type="submit" id="delete" value="Delete"></td></tr>
    //mysql connection here
    if($_POST['delete']) // from button name="delete"
    $checkbox = $_POST['checkbox']; //from name="checkbox[]"
    $countCheck = count($_POST['checkbox']);
    $del_id = $checkbox[$i];
    $sql = "delete from test_mysql where id = $del_id";
    $result = mysql_query($sql, $dbconn);
    echo "successful delete";
    echo "Error: ".mysql_error();

    Problem: Undefined index: delete in delete.php on line 31
Someone help me solve it.

It is a notice. This is not a serious warning. It just tells you that you are using a variable that has not been defined yet.

Two possible fixes:
1. Turn off the reporting of notices (e.g. error_reporting(E_ALL & ~E_NOTICE); on the first line of your first script).
2. Instead of using if ($_POST['delete']), use if (!empty($_POST['delete'])).

You submit: ->

if(isset($_POST['delete')) {
I see only one )

Hope I'm rigth!