title: PHP. Zend DB adapter
body: <p>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. </p>
  
  <p>When it's show chaotically code was: </p>
  
  <pre><code>foreach ($_tags as $item) {
      $select = new Select();
      $tags[] = $this-&gt;getGalleryTagsTable()-&gt;fetchAll($select-&gt;where(array('id' =&gt; $item)));
  }
  </code></pre>
  
  <p>To make sorting by field "index", I created this field and wrote this code:</p>
  
  <pre><code>foreach ($_tags as $item) {
      $select = new Select();
      $tags[] = $this-&gt;getGalleryTagsTable()-&gt;fetchAll($select-&gt;where(array('id' =&gt; $item))-&gt;order('index DESC'));
  }
  </code></pre>
  
  <p>but it still doesn't work. I tried to write without 'DESC' &amp; tried to sort by 'id'. None of these work.</p>