I have a query like this
SELECT TOWN, NAME FROM CINEMA WHERE CITY_ID = ".$_POST['country']." GROUP BY TOWN, NAME
In view side, I take the values with the help of template_lite
<table border="1" >
<br />
{foreach value=mp from=$mpbycity}
<tr><td>{$mp.TOWN}</td></tr>
<tr><td>{$mp.NAME}</td></tr>
{/foreach}
</table>
The problem is the duplicates.You can see from below pic.
I tried array_unique but it does not work.

First, you must filter variable before writing inside query
..CITY_ID = ".$_POST['country'].". With this code attacker can inject code on query. Check Sql injection. To avoid this use mysql_real_escape_string().And to unique array, you can use
array_unique(),SELECT DISTINCT,GROUP BYclauses. Also in loop can avoid to write duplicate values to array. All depends on your database structure and query.