<?php
 
/**
* Delete Record from Database
*
* This script deletes a record from the
* MySQL database.
* 
* @author       Blaze Script
* @website      https://blazescript.com
* @date         January 2019
*/
 
$dc_host = "localhost";     // Host Name
 
$dc_user = "admin";     // Username
 
$dc_pass = "password";      // Password
 
$dc_db = "database";        // Database Name to Create
 
// Create connection
$dc_conn = new mysqli($dc_host, $dc_user, $dc_pass, $dc_db);
 
// Check connection
if ($dc_conn->connect_error) {
    die("Connection failed: " . $dc_conn->connect_error);
} 
 
// Delete record from database
$ir_sql = "DELETE FROM table_name WHERE column_name = value";
if ($dc_conn->query($ir_sql) === TRUE) {
    echo "Record was deleted successfully";
} else {
    echo "Error: " . $dc_conn->error;
}
 
// Close the connection
$dc_conn->close();
 
?>