title: How to join tables in Zend Framework?
body: <p>Hi I have my query in codeigniter since I I have switch to Zend Framework, I wanted do my query in zend framework:</p>
  
  <p>Here is my sample query:</p>
  
  <pre><code>$sql = "SELECT Mes.fromid, Mes.is_read AS is_read, Mes.id AS mesid, Mes.message AS message, 
                   max(Mes.date) AS date, User.username AS username, User.id AS Uid
                  FROM  `messages` AS Mes
                  LEFT JOIN users AS User ON User.id = Mes.fromid
                  WHERE Mes.toid = ? AND Mes.fromid &lt;&gt; ?
                  GROUP BY Mes.fromid ORDER BY date DESC"; 
  
          $query = $this-&gt;db-&gt;query($sql, array($fromid, $fromid));
  
          return $query-&gt;result();
  </code></pre>
  
  <p>Thank you for you help.</p>