I'm trying to create a delete form that is connected to a database using xampp, but I keep getting fatal errors and honestly I don't know what to do anymore.The form is supposed to read the name that has been inputed and look for it in the database and then delete it. This is my HTML code
<!DOCTYPE html>
<html>
<head>
<title>Circuit delete</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css" />
</head>
<body>
<div class="container">
<div class="row col-md-6 col-md-offset-3">
<div class="panel panel-primary">
<div class="panel-heading text-center">
<h1>Circuit delete</h1>
</div>
<div class="panel-body">
<form action="delete_circuits.php" method="post">
<div class="form-group">
<label for="name">Insert the name of the circuit you want to delete:</label>
<input
type="text"
class="form-control"
id="name"
name="name"
/>
</div>
<input type="submit" name="delete" value="Delete" class="btn btn-primary" />
</form>
</div>
<div class="panel-footer text-right">
<small>© Coman Emanuel</small>
</div>
</div>
</div>
</div>
<div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
<img src="..." class="rounded mr-2" alt="...">
<strong class="mr-auto">Bootstrap</strong>
<small>11 mins ago</small>
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="toast-body">
Hello, world! This is a toast message.
</div>
</div>
</body>
</html>
and this is the php code
<?php
$link = mysqli_connect("localhost", "root", "", "formula1_db");
if($link === false){
die("ERROR: Could not connect. " . mysqli_connect_error());
}
$name=$_POST['name'];
$sql = "DELETE FROM circuits WHERE 'circuits'.'name'=$name";
if(mysqli_query($link, $sql)){
echo "Record was deleted successfully.";
}
else{
echo "ERROR: Could not able to execute $sql. "
. mysqli_error($link);
}
mysqli_close($link);
?>
This is the error that I keep getting
Fatal error: Uncaught mysqli_sql_exception: Unknown column
I would really appreciate some help as soon as possible.