Ulfat » 2010.05.10 16:10

U menya top reyting statistika po stranam povtaraetsya kak mozhna popravit?
Primer: xhtml html
kod takoy
$result = mysql_query("
SELECT `top_operators`.`country`, `top_operators_stat`.`count`
FROM `top_operators_stat`
LEFT JOIN `top_operators`
ON `top_operators`.`id` = `top_operators_stat`.`id_operator`
WHERE `date` = '$today' AND `day_week` = $week_day AND `uid` = $uid
ORDER BY `top_operators_stat`.`count` DESC
");

Gemorroj » 2010.05.10 16:16

в какой таблице хранятся страны?

Gemorroj » 2010.05.10 17:49

GROUP BY `top_operators`.`country`

Ulfat » 2010.05.10 18:29

Gemorroj написал:

GROUP BY `top_operators`.`country`

Kuda dobavit?

Gemorroj » 2010.05.10 18:42

перед ORDER BY

Ulfat » 2010.05.10 19:23

paluchilas nu sechas xit ne pravilna pokazivaet
Primer: New| Staroe

Ulfat » 2010.05.10 20:26

Gemorroj, esho est takoy kadirovka
$result = mysql_query("SELECT DISTINCT `top_operators_stat`.`id_operator`, SUM(`top_operators_stat`.`count`) AS `count`, `top_operators`.`country` as `country` FROM `top_operators_stat`, `top_operators` WHERE `top_operators_stat`.`uid` = ".$uid." AND `date` = $date AND `top_operators_stat`.`id_operator` = `top_operators`.`id` GROUP BY `top_operators`.`country` ORDER BY 2 DESC;");
zdes vsego normalnya pakazivaet kromi (Другие) strana ne pokazivaet kak mozhna zdelat chtobi (Другие) strani tozhe pokazall?
Primer: xhtml

Gemorroj » 2010.05.11 11:27

верни таблицы плз. в запросах куча хлама, и мне не совсем понятна структура хранения данных.

Ulfat » 2010.05.11 14:33

Struktura: Struktura

Gemorroj » 2010.05.11 19:49

Код:

1
2
3
4
5
6
SELECT `top_operators`.`country`, SUM(`top_operators_stat`.`count`) AS `cnt`
FROM `top_operators_stat`
LEFT JOIN `top_operators` ON `top_operators`.`id` = `top_operators_stat`.`id_operator`
WHERE `date` = '$today' AND `day_week` = $week_day AND `uid` = $uid
GROUP BY `top_operators`.`country`
ORDER BY `cnt` DESC
Ulfat » 2010.05.11 22:03

chlavek geni prosta super spasibo balshoe Gemaroj ya znal krome tebya ne kto ne smog eta zdelat