如何根据最后一个MySQL MySQL PHP以降序显示所选记录

I am trying to display MySQL database selected records in descending order based on the last id. but it's not working please see the SQL statement below

SELECT * FROM product WHERE catagory='$pro' AND id >($id) LIMIT 6 DESC

I want to show only 6 records at a time.

add an order by eg:

  SELECT * FROM 
  product WHERE catagory='$pro' AND id >($id) 
  ORDER BY id DESC  LIMIT 6 

but you should not use php var in sql you are at risk for sql injection

take a look at your sql driver for use binding param

SELECT
  *
FROM
  product
WHERE
  catagory = '$pro'
  AND id > ($id)
ORDER BY id desc
LIMIT 6;