title: delete a specific row of a table using php
body: <p>I have designed a table that will display data something like this:</p>
  <pre><code>ID  name    Delete
  1   abc     Delete
  2   def     Delete
  </code></pre>
  <p>the code used for the above display is</p>
  <pre><code>&lt;?php
  $con=mysqli_connect(&quot;abc&quot;,&quot;abc&quot;,&quot;abc&quot;,&quot;abc&quot;);
  // Check connection
  if (mysqli_connect_errno()) 
  {
  echo &quot;Failed to connect to MySQL: &quot; . mysqli_connect_error();
  }
  $result = mysqli_query($con,&quot;SELECT * FROM student&quot;);
  echo &quot;&lt;table class='table table-striped table-bordered table-hover'&gt;
  &lt;thead&gt;
  &lt;tr&gt;
  &lt;th&gt;ID&lt;/th&gt;
  &lt;th&gt;name&lt;/th&gt;
  &lt;th&gt;delete&lt;/th&gt;   
  &lt;/tr&gt;
  &lt;/thead&gt;&quot;;
  while($row = mysqli_fetch_array($result)) 
  {
  echo &quot;&lt;tbody data-link='row' class='rowlink'&gt;&quot;;
  echo &quot;&lt;tr&gt;&quot;;
  echo &quot;&lt;td&gt;&quot; . $row['id'] . &quot;&lt;/td&gt;&quot;;
  echo &quot;&lt;td&gt;&quot; . $row['name'] . &quot;&lt;/td&gt;&quot;;
  echo &quot;&lt;td&gt;&lt;a href='delete.php'&gt;Delete&lt;/a&gt;&lt;/td&gt;&quot;;
  echo &quot;&lt;/tr&gt;&quot;;
  echo &quot;&lt;/tbody&gt;&quot;;    
  }
  echo &quot;&lt;/table&gt;&quot;;
  mysqli_close($con);
  ?&gt;
  </code></pre>
  <p>code for delete.php</p>
  <pre><code>&lt;?php
  $con=mysqli_connect(&quot;abc&quot;,&quot;abc&quot;,&quot;abc&quot;,&quot;abc&quot;);
  // Check connection
  if (mysqli_connect_errno()) {
  echo &quot;Failed to connect to MySQL: &quot; . mysqli_connect_error();
  }
  mysqli_query($con,&quot;DELETE FROM student WHERE id='$id'&quot;);
  mysqli_close($con);
  header(&quot;Location: index.php&quot;);
  ?&gt; 
  </code></pre>
  <p>View of database is</p>
  <pre><code>Id  name
  1   abc
  2   cdf
  </code></pre>
  <p>the problem is that it is not deleting the data and is also not showing any error</p>