嗨,我在 codeigniter 中有我的查询,因为我已经切换到 Zend 框架,我想在 zend 框架中进行查询:
这是我的示例查询:
$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 <> ?
GROUP BY Mes.fromid ORDER BY date DESC";
$query = $this->db->query($sql, array($fromid, $fromid));
return $query->result();
谢谢你的帮助。