1.Make a File delete.php with the Code
<html>
<head>
<title>Delete</title>
</head>
<body>
<?php
$link=mysql_connect("localhost
mysql_select_db("table",$lin
$query="SELECT * FROM student";
$resource=mysql_query($query,$
echo "
<table align=\"center\" border=\"0\" width=\"70%\">
<tr>
<td><b>name</b></td> <td><b>class</b></
while($result=mysql_fetch_arra
{
echo "<tr><td>".$result[1]."</
<a href=\"delete2.php?id=".$resul
</td></tr>";
} echo "</table>";
?>
</body>
</html>
2.Create a File delete2.php with the code:
<html>
<head>
<title>Delete panel</title>
</head>
<body>
<?php
$id=$_REQUEST['id'];
$link=mysql_connect("localhost
mysql_select_db("table",$lin
$query="DELETE FROM student WHERE id='".$id."'";
if(!mysql_query($query,$link))
{die ("An unexpected error occured while <b>deleting</b> the record, Please try again!");}
else
{
echo "Record ".$id." removed successfully!";}
?>
</body>
</html>
3. Create Database in Server:
Database name: table
table name : student
column name:id,name,class,rollno



No comments:
Post a Comment