There is gallery on my site, and every picture has own tag. All of the tags are sorting chaotically. I want to sort them by value of field "index" in galleryTagsTable.
When it's show chaotically code was:
foreach ($_tags as $item) {
$select = new Select();
$tags[] = $this->getGalleryTagsTable()->fetchAll($select->where(array('id' => $item)));
}
To make sorting by field "index", I created this field and wrote this code:
foreach ($_tags as $item) {
$select = new Select();
$tags[] = $this->getGalleryTagsTable()->fetchAll($select->where(array('id' => $item))->order('index DESC'));
}
but it still doesn't work. I tried to write without 'DESC' & tried to sort by 'id'. None of these work.