Issue 5373: social group activities non-functional

Ticket Link: http://atutor.ca/atutor/mantis/view.php?id=5373

A comma (,) was being used instead of a dot (.)
It should have been a.id and not a,id
This error was there in the original mysql_query even before the queryDB optimization was performed.