Skip to main content
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
hope I can explain my problem clearly. Okay, I will try..
I have created a dataobject with data sets like this:
1. data set: name1 - adress1 - town1
2. data set: name2 - adress2 - town1
3. data set: name3 - adress3 - town2
4. data set: name4 - adress4 - town2
3. data set: name5 - adress5 - town3
You can see that different people are living in different towns.
Now I would like to know in which different towns the people are living.
The desired result should be: town1, town2 and town3
Any ideas? Thanks everybody for support,
If you start with a GROUP BY sql statement:
$sql = singleton('SomeObject')->buildSQL();
$sql->select = "town";
$result = $sql->groupby("town")->execute();
And then pass the result into a dataobject you can use:
$groupObject = singleton('SomeObject')->buildDataObjectSet($result);
Just return $groupObject and you can use it in your template.
thank you so much. Your job works perfectly!