Yong Scott
asked on
The record inside mysql not deleted
<?php
include 'config.php';
?>
<!DOCTYPE html>
<html>
<head>
<title>File Uploading With PHP and MySql</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div id="header">
<label> Delete by date </label>
</div>
<br /><br />
<form action="index.php" method="post" enctype="multipart/form-data">
<button type="submit" name="btn-main" style="height: 25px; width: 200px">MAIN PAGE</button>
</form>
<br /><br />
<form>
<div id="body">
<input type="date" name="dd" placeholder="YY-MM-DD" required />
<input type="submit" name="delete" value="Submit"/>
</form>
<br/><br/>
</body>
</html>
<?php
if(isset($_POST['delete']))
{
$date = $_POST['dd'];
// mysql delete query
$query = "DELETE FROM nov WHERE date = $date";
if(mysqli_query($db, $query)) {
?>
<script>
alert('successfully delete date');
window.location.href='index.php?success';
</script>
<?php
}else{
?>
<script>
alert('failed delete date');
window.location.href='index.php?success';
</script>
<?php
}
mysqli_close($db);
}
?>
The record not delete when i put date, anyone know any mistake over there , I tried change again and again still same .
it seems that your php scripts only delete the record in MySQL and regardless of what condition, it's not deleting the file (no delete file scripts found in the php scripts...)
ASKER
ya i edit the question first , i want to delete the record inside mysql hehe
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OMG its work .. I do the minor mistake then its failed LOL. Thanks for help