Skip to content
Advertisement

Fetch featured product only from product table in Api

Product Table enter image description here

where i want to fetch only featured product. I have defined a column in database product_type in which four types of products(hot deals, newly listed, deals of the day and featured product)strong text can be listed which is optional.

Blockquote

JavaScript

When i try to fetch whole product list in api i get the result but i want to show only featured product.

Advertisement

Answer

As I have changed my database to separate table with product_id matching with product_type. Still I find the solution to my question with a function FIND_IN_SET().

Here is my updated modal query:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement