What would be the easiest way to show all locations with a parent id.
To explain I have multiple locations within countries.
I want a link which will show all locations in a country, eg all counties in England. England has the parent id of "18" and the counties have id's from 1 to 40.
If someone clicked on "show all listings in England" to show all listings in England.
Can I just add all the id's to this in MYSQL or is there something I can change to the php code?
Thanks in advance...
This is the code:
{if isset($location)}{$location.title}{else}{$lang.choose_location}{/if}</strong>
</span>
(<a href="#" onclick="return false;"><span id="locationChangeLabel"></span></a>)
</legend>
<input type="hidden" name="locations" id="location_id" value="{if isset($location)}{$location.items}{/if}" />
<input type="hidden" name="location_title" />
and
$eSyndiCat->setTable('locations');
$locations = $eSyndiCat->all("*", "`id_parent` = :id", array('id' => $aLocation));
foreach($locations as $key => $location)
{
$div = '';
$subcategories = $eSyndiCat->all("*", "`id_parent` = '{$location['id']}'");
$tree .= "<option value=\"{$location['id']}\">";
$level = count(explode('/', $location['path']));
}
function getTree($locationId = 0)
{
global $eSyndiCat;
$out = array();
$eSyndiCat->setTable('locations');
$locations = $eSyndiCat->all('*', "`id_parent` = :id order by `title`", array('id' => $locationId));//Fix