Answer the question
In order to leave comments, you need to log in
How to make a mysql selection with the calculation of the number of unique values?
Unable to add unique c.catalog_id count to this query
$contacts = $dbh->prepare("
SELECT r.title AS region_title,
c.title,
c.region_id,
c.id,
c.catalog_id,
c.address,
c.phone,
c.email,
c.website,
c.category_title,
c.subcategory_title,
c.subcategory_id,
c.manufacturer
FROM contacts AS c
LEFT
JOIN regions AS r
ON c.region_id = r.id
WHERE manufacturer = 1
AND region_id IN (".implode(',', $regions).")
AND subcategory_id IN (".implode(',', $categories).")
");
$contacts->execute();
$contacts->fetchAll(PDO::FETCH_GROUP);
array() {
["Хабаровск"]=>
array() {
contact1
contact2
...
},
["Чебоксары"]=>
array() {
contact3
contact4
...
}
}
Answer the question
In order to leave comments, you need to log in
waited for loading seconds 20
closed nafik
don't make such a hover effect
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question