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);
}

      
?>

Open in new window


The record not delete when i put date, anyone know any mistake over there , I tried change again and again still same .
Yong Scott Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
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...)
1
Yong Scott Author Commented:
ya i edit the question first , i want to delete the record inside mysql hehe
0
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
missing the quotes? quick try:

$query = "DELETE FROM nov WHERE date = '$date'";
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Yong Scott Author Commented:
OMG its work .. I do the minor mistake then its failed LOL. Thanks for help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.