Q: Delete query not working in following php code I am trying to delete record through id
here is my code:
if(isset($_GET['del'])){
  $i=$_GET['a'];
  $q="DELETE FROM Registration WHERE ID='".$i."'";
  mysql_query($q,$conn) or die(mysql_error());
  echo "deleted";
}

above code is working and echo statement is executed too but the record from database is not deleting. But when i put actual id num instead of $i, the record gets deleted.

A: try accessing the script directly in a browser and compare it to the link in your address bar when you access the script from your delete page.
For your code to work it needs to look something like this:
http://path/to/yourscript.php?del=1&a=<id to delete>

If that works, then your calling script/form is not set up correctly, you'll need a form input that has the name 'a'. e.g. <input type='text' name="a"> and an input called 'del', probably your submit button.

A: You are sending in your query the value of ID as string. Try: 
$q="DELETE FROM Registration WHERE ID=$i";

Also make sure that you are getting an int.
$i=(int)$_GET['a'];

