Answer the question
In order to leave comments, you need to log in
How to make the output of goods on the site, under these conditions?
There is a website and it has several sections. Each such section consists of a set of tabs, in each tab there is a slider, in the slider there are products.
How to display all these products by category SQL query from the database, in php. I don’t understand what request to make and how to organize a cycle so that products for each category are displayed. At the same time, it is necessary to be able to select these products from the admin panel, but this is another matter.
Answer the question
In order to leave comments, you need to log in
How to display all these products by category SQL query
SELECT * FROM someTable
WHERE category='someCategory'
foreach($products as $product){
...
}
[
'category_id_1' => [
'product1' => [],
...
'product999' => [],
]
'category_id_2' => [
'product1' => [],
...
'product999' => [],
]
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question