In this example we use 3 file for Delete record or Data using Oracle and PHP.
<!DOCTYPE html>
<html>
<head>
<title>Delete employee data</title>
</head>
<body>
<table>
<tr>
<td>First Name</td>
<td>Last Name</td>
<td>City</td>
<td>Email id</td>
<td>Action</td>
</tr>
<?php
$i=0;
while($row=oci_fetch_array($result)) {
?>
<tr>
<td><?php echo $row["first_name"]; ?></td>
<td><?php echo $row["last_name"]; ?></td>
<td><?php echo $row["city_name"]; ?></td>
<td><?php echo $row["email"]; ?></td>
<td><a href="delete_ process.php?userid=<?php echo $row["userid"]; ?>">Delete</a></td>
</tr>
<?php
$i++;
}
?>
</table>
</body>
</html>
<?php
$conn=oci_connect("COMMON","ADMIN","172.16.16.20/WETDB");
if (!$conn) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
?>
<?php
include_once 'database.php';
$query = oci_parse($conn, "DELETE FROM employee WHERE userid='" . $_GET["userid"] . "'");
$result = oci_execute($query, OCI_DEFAULT);
if($result)
{
oci_commit($conn); //*** Commit Transaction ***//
echo "Data Deleted Successfully.";
}
else{
echo "Error.";
}
?>