Delete Records With Effect Using jQuery And PHP

Updated click here 0 Tallied Votes 166 Views Share

Overview

this is a fast way to delete Records from your mysql datebase without loading the page .

this jquery code can Delete a Record with animation fade-out effect using jQuery and Ajax.
<FAKE SIGNATURE>

<?php

mysql_select_db('users',mysql_connect('localhost','root',''));

?>
<?php
include ('db.php');

if(isset($_POST['id'])){
$id = intval($_POST['id']);   
$delete = mysql_query("delete from users where id='$id'");
exit;
}

$sql = mysql_query("select * from users order by id asc");

echo "<ul>";

while($Row = mysql_fetch_array($sql)){
extract($Row);   
echo "<li>$name [<a id='$id' style='color:#ff0000;' class='delete' href='#'>Delete</a>]</li>\n";   
}

echo "</ul>";

?>