Skip to content

Instantly share code, notes, and snippets.

@michaeltwofish
Created May 20, 2010 01:31
Show Gist options
  • Save michaeltwofish/407081 to your computer and use it in GitHub Desktop.
Save michaeltwofish/407081 to your computer and use it in GitHub Desktop.
public function get_years_array()
{
$years = DB::get_column(
"SELECT DISTINCT habari__postinfo.value from habari__posts
INNER join habari__posttype on habari__posts.content_type = habari__posttype.id and habari__posttype.name = ?
left join habari__postinfo on habari__posts.id = habari__postinfo.`post_id` and `habari__postinfo`.name = ?
ORDER BY habari__postinfo.value DESC",
array('imprint', 'year')
);
return $years;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment