Delete Data



<?php include("configuration.php"); ?>
<?php
$result=mysql_query("select*from info") or die (mysql_error());
echo"<table border='1'>
<tr>
                                    <th>Name:</th>
                                    <th>Address</th>
                                    <th>Phone:</th>
                                    <th> Delete </th>
                        </tr>";
while ($row=mysql_fetch_array ($result)) {
            echo"<tr>";
                        echo "<td>" .$row['name']. "</td>";
                        echo "<td>" .$row['address']. "</td>";
                        echo "<td>" .$row[‘cell’]. "</td>";
                        // delete script
                        echo"<td><a href=\"script.php?delid=".$row['id']."\">" .Delete. "</a></td>";
                        echo "</tr>"; }
echo "</table>";
?>
File Name: Script.php
<?php
include("config.php");

// delete data from database start
$del=$_GET['delid'];
$redirect="delete_data.php";
mysql_query("delete from info where id='$del'");
header("Location: $redirect");
// delete data from database start
?>

Loading
Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Flying Twitter Bird Widget By ICT Sparkle