error: Notice: Undefined offset: 1 in C:\wamp\www\project\php\deleteRow.php on line 55
<p>I got this error when trying to delete emails from a table form and database,,i tried to solved it but some fields work while others still gives me an error, any help is apreciated,,i am learning php on my own.</p>

<p>/<em>here is my code</em>/</p>

<pre><code>&lt;?php
 $dbhost = 'host';

 $dbuser = 'username';

 $dbpass = 'password';

 $dbname = 'databe_name';

 $dbtable = 'database_table';

 $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
 //
 mysql_select_db($dbname,$conn) or die ("Could not open database");
 //
$sql="SELECT * FROM '$dbtable'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
?&gt;
&lt;table width="400" border="0" cellspacing="1" cellpadding="0"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;form name="form1" method="post" action=""&gt;
&lt;table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"&gt;
&lt;tr&gt;
&lt;td bgcolor="#FFFFFF"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td colspan="4" bgcolor="#FFFFFF"&gt;&lt;strong&gt;Delete multiple rows in mysql&lt;/strong&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="center" bgcolor="#FFFFFF"&gt;#&lt;/td&gt;
&lt;td align="center" bgcolor="#FFFFFF"&gt;&lt;strong&gt;Id&lt;/strong&gt;&lt;/td&gt;
&lt;td align="center" bgcolor="#FFFFFF"&gt;&lt;strong&gt;Sender&lt;/strong&gt;&lt;/td&gt;
&lt;td align="center" bgcolor="#FFFFFF"&gt;&lt;strong&gt;Message&lt;/strong&gt;&lt;/td&gt;
&lt;td align="center" bgcolor="#FFFFFF"&gt;&lt;strong&gt;Date&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;?php
while($rows=mysql_fetch_array($result)){
?&gt;
&lt;tr&gt;
&lt;td align="center" bgcolor="#FFFFFF"&gt;&lt;input name="checkbox[]" type="checkbox" id="checkbox[]" value="&lt;?php echo $rows['id']; ?&gt;"&gt;&lt;/td&gt;
&lt;td bgcolor="#FFFFFF"&gt;&lt;?php echo $rows[0]; ?&gt;&lt;/td&gt;
&lt;td bgcolor="#FFFFFF"&gt;&lt;?php echo $rows[2]; ?&gt;&lt;/td&gt;
&lt;td bgcolor="#FFFFFF"&gt;&lt;?php echo $rows[3]; ?&gt;&lt;/td&gt;
&lt;td bgcolor="#FFFFFF"&gt;&lt;?php echo $rows[4]; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;?php
}
?&gt;
&lt;tr&gt;
&lt;td colspan="5" align="center" bgcolor="#FFFFFF"&gt;&lt;input name="delete" type="submit" id="delete" value="Delete"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;?php
// Check if delete button active, start this
if(isset($_POST['delete'])){
    for($i=0;$i&lt;$count;$i++){
            $del_id = $_POST['checkbox'][$i]; /*this line gives me an error*/
            $sql = "DELETE FROM '$dbtable' WHERE id='$del_id'";
            $result = mysql_query($sql);
    }
    // if successful redirect to delete_multiple.php
if($result){
    echo "&lt;meta http-equiv='refresh' content='0' URL='deleteRow.php'&gt;";
}
}
mysql_close();
?&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;/td&gt;
&lt;/tr&gt;
</code></pre>
