I'm making a website where you can find manuals of different brands of cars. I have a table with ID, NAME, LINK, and CATEGORY. I want that if you click the DIV with the attribute "ford", you select all from the table where category is ford. This is my code:
jQuery
$('div').click(function(){
var cat = $(this).attr('category');
});
and the SQL:
$connect = new PDO('mysql:host=localhost;dbname=manuals', 'root','');
$cmd = $connect -> query("SELECT * FROM `manuals` WHERE `category`='ford'");
$resultado = $cmd->fetchAll(PDO::FETCH_ASSOC);
I know that PHP is a server side language and JS not, and JS is event driven, and all the story, but what is the easiest way to achieve this? Do I need to use forms and stuff?
Sorry for bad english!