I made an application for taxi service with PHP and MySQL. And I use PDO for connecting. I setup an admin panel and I wrote a delete query for delete unwanted price records according to its priceid. But nowadays I lost all price data(Table become empty) sometimes without any action from Admin. Please check my delete query page code below. Thank you for your time.
ob_start();
include 'inc/database.php';
include 'inc/header.php';
if (isset($_GET['getid'])) {
$getId = $user -> cleaninput($_GET['getid']);
}
else {
header("Location:prices.php");
}
if (!empty($getId) && is_numeric($getId)) {
$adData = $DB_con->prepare("DELETE FROM price_data WHERE price_ID=".$getId." LIMIT 1");
$adData -> execute();
header("Location:prices.php");
}
else {
header("Location:prices.php");
}