954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

Delete Records With Effect Using jQuery And PHP

0
By click here on Sep 22nd, 2009 12:54 am

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.

<?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>";

?>

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You