title: how to delete multiple records from database with checkboxes and update in php
body: <p>`  
              
  
  <pre><code>   ?&gt;
    &lt;table border="1"&gt;
        &lt;tr&gt;
    &lt;th&gt;&lt;input type="checkbox" id="selectall"/&gt;&lt;/th&gt;
    &lt;th style="width:86px;"&gt;News ID&lt;/th&gt;
   &lt;th style="width:150px;"&gt;Title&lt;/th&gt;
    &lt;th style="width:590px;"&gt;&lt;center&gt;Description&lt;/center&gt;&lt;/th&gt;
   &lt;th style="width:100px;"&gt;Status&lt;/th&gt;
   &lt;th rowspan="1" colspan="2" style="width:350px"&gt;&lt;center&gt;Action &lt;/center&gt;&lt;/th&gt;
   &lt;/tr&gt;
   &lt;?php
      while ($rows= mysql_fetch_array($result)) {
  ?&gt;
  &lt;tr&gt;
   &lt;td align="center" bgcolor=""&gt; &lt;input name="checkbox[]" type="checkbox" id="checkbox[]" 
   value="&lt;? echo $rows['news_id']; ?&gt;"&gt; &lt;/td&gt;
    &lt;td&gt;&lt;center&gt;&lt;?php echo $rows["news_id"]; ?&gt;  &lt;/center&gt;&lt;/td&gt;
      enter code here&lt;td&gt;&lt;center&gt;&lt;?php echo $rows["news_title"]; ?&gt; &lt;/center&gt;&lt;/td&gt;
     &lt;td&gt;&lt;center&gt;&lt;?php echo $rows["news_content"]; ?&gt;&lt;/center&gt;  &lt;/td&gt;
     &lt;td&gt;&lt;center&gt;&lt;?php echo $rows["status"]; ?&gt;&lt;/center&gt; &lt;/td&gt;
     &lt;td&gt;&lt;center&gt;&lt;a href="update_data.php&lt;?php echo $var ?&gt;"&gt;&lt;img src="images/update.jpg"  
      height="40px" width="100px" /&gt;&lt;/a&gt;&lt;/center&gt; &lt;/td&gt;
     &lt;td&gt;&lt;center&gt;&lt;a href=""&gt;&lt;img src="images/delete.jpg" height="40px" width="100px" /&gt;&lt;/a&gt; 
      &lt;/center&gt; &lt;/td&gt;
      &lt;/tr&gt;
       &lt;?php
         }
           ?&gt;
  
          &lt;?php
          include('dbconnect.php');
             $del_id = $_POST['checkbox']; 
               $detectinglocations = 'news_id';
  
             foreach($del_id as $value){
              $sql = "DELETE FROM ".$detectinglocations." WHERE id='".$value."'";
          $result = mysql_query($sql);
                 }
             }
  
  
            ?&gt;
  
            ?&gt;
          &lt;tr&gt;
        &lt;td&gt; &lt;/td&gt;
     &lt;/tr&gt;
            &lt;/table&gt;'
  </code></pre>
  
  <p>This is the code I have done so far... But don't knw what to do ahead.. Help me if anybody knws..!!!</p>
  
  <p>I want to Delete Multiple Records with checkboxes and select all delete rows and particular rows delete </p>