Created
March 21, 2012 14:16
-
-
Save robertbasic/2147227 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$adapter = $this->getAdapter(); | |
$langQuoted = $adapter->quote($lang); | |
$sql = " | |
(SELECT * FROM `news` WHERE published = 1 AND lang = " . $langQuoted . ") | |
UNION ALL | |
(SELECT * FROM `events` WHERE published = 1 AND lang = " . $langQuoted . ") | |
ORDER BY `date` DESC | |
"; | |
$statement = $adapter->query($sql); | |
$result = $statement->fetchAll(); | |
return $result; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment