title: delete a specific data in a array using php
body: <p>Am creating a simple todo app. In that i want to user to delete a todo. i am trying to delete but it deletes the whole table. And also i try including row but it fails. can anyone help me to solve this?</p>
  
  <p>table.php:</p>
  
  <pre><code> &lt;?php 
   include('connect.php');
  $sql="SELECT * FROM tasks";
  
  $result = mysql_query($sql);
  
  $myArray = array(); 
  
  echo "&lt;table  style='width:80%;'&gt;
  &lt;tr&gt;
  &lt;th style='text-align:center;'&gt;TaskName&lt;/th&gt;
  &lt;th style='text-align:center;'&gt;status&lt;/th&gt;
  &lt;th style='text-align:center;'&gt;Description&lt;/th&gt;
  &lt;th style='text-align:center;'&gt;DueDate&lt;/th&gt;
  &lt;/tr&gt;";
  
  $index = 0;
  while($row = mysql_fetch_assoc($result))
  { 
   $myArray[$index] = $row;
   $index++;
  
  echo "&lt;tr&gt;";
  echo "&lt;td style='text-align:center;'&gt;" . $row['task'] . "&lt;/td&gt;";
  echo "&lt;td style='text-align:center;'&gt;" . $row['status'] . "&lt;/td&gt;";
  echo "&lt;td style='text-align:center;'&gt;" . $row['description'] . "&lt;/td&gt;";
  echo "&lt;td style='text-align:center;'&gt;" . $row['due'] . "&lt;/td&gt;";
  echo "&lt;td&gt; &lt;a href='delete.php'&gt; &lt;button class='btn  btn-default'&gt;Delete Task&lt;/button&gt;&lt;/a&gt;&lt;/td&gt;" ;
  echo "&lt;/tr&gt;";
  
  
  }
  ?&gt;
  </code></pre>
  
  <p>delete.php:</p>
  
  <pre><code>&lt;?php
  include('connect.php');
  
  unset($myArray[$task]);
  
  header("Location: dash.php");
  ?&gt; 
  </code></pre>