Hi, so this is the most basic thing ever but i am having trouble with it. idk if its because of the code or it just can't be done or idk something. I am trying to retrieve from database by clicking on a [input type submit] button but I am getting Fatal Error near my WHERE syntax.
<input type="submit" name="bf" class="btn btn-default filter-button" value="Bowls & Feeders">
<?php
if(isset($_GET['bf'])){
$cat = "Bowls & Feeders";
$query = $conn->prepare("SELECT * FROM table WHERE type = ':type");
$query->bindParam(':type', $cat, PDO::PARAM_STR);
$query->execute();
$result = $query->fetch(PDO::FETCH_ASSOC);
}
?>
I have stared at the code for awhile that i might go blind. please help. thank you in advance.