I have a table with the following data id, name, price, category, description, but I want to make a query according to the category, for example, if I select the chairs category just print those rows that have that category in said column.
I hope the subject is not repeated, I've been searching in Google how to sort the data, but I always get the ascending and descending order.
I have also seen that some javascript library can work, like ajax or jquery.
Hazta now I do not have any problem with the code in the way I am using it, it has worked, but now I want to take the next step, I do not want all the products I have in the table to appear.
This is the code:
<?php
include("conexion.php");
$query = "SELECT * FROM productos";
$resultado = $conexion->query($query);
while ($row = $resultado->fetch_assoc()) {
?>
<?php echo base64_encode($row['product_img']);?>
<?php echo $row['product_price']; ?>
<?php echo $row['product_name']; ?>
<?php echo $row['product_description']; ?>
If you look there you can see the different products, I want you to click on the office one to show me the office ones and if I click on chairs, just show me those. Thanks