select * from products where categoryid= $cat_id LIMIT " . $offset . ',' . $limit
This is the query I have used for fetching products from the table based on category id. It is returning only 2 rows when there are 3 rows with the same category id. offset is 0 and limit is 2
Read more here: https://stackoverflow.com/questions/64404328/how-to-use-where-clause-with-limit-and-offset
This content was originally published by Divya Godavarti at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.