| $q = sqlquery($dbh, " | $q = sqlquery($dbh, " | ||||
| SELECT | SELECT | ||||
| SUM(pw.count) AS count | SUM(pw.count) AS count | ||||
| l.short AS lang | |||||
| l.short AS short | |||||
| FROM pages_words pw | FROM pages_words pw | ||||
| JOIN words w ON pw.wordID = w.id | JOIN words w ON pw.wordID = w.id | ||||
| JOIN lang l ON w.langId = l.id | JOIN lang l ON w.langId = l.id | ||||
| WHERE pw.pageId = ?", $page->{id}); | |||||
| WHERE pw.pageId = ? | |||||
| GROUP BY l.id", $page->{id}); | |||||
| while(my $h = $q->fetchrow_hashref()) { | while(my $h = $q->fetchrow_hashref()) { | ||||
| $lang{$h->{lang}}=$h->{count}; | $lang{$h->{lang}}=$h->{count}; | ||||
| } | } |