PDO FetchAssoc not filtering ((solved))

I am working on this script to fetch data from my column=Department with values=Arts. But when I display it all entries are still present, it isn’t fetching only the ones that matches my SELECT. Can you explain where I went wrong?

<?php
require 'scripts/start.php';
$pages = $db->query("SELECT department FROM content WHERE department='Art'
")->fetch(PDO::FETCH_ASSOC);

  require VIEW_ROOT . '/artpages.php';
?>

this should help:

but if you still have problems then please report back to us. Helping each other is a good thing.

Sponsor our Newsletter | Privacy Policy | Terms of Service