Skip to content

Instantly share code, notes, and snippets.

@tomschlick
Created July 5, 2010 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomschlick/464053 to your computer and use it in GitHub Desktop.
Save tomschlick/464053 to your computer and use it in GitHub Desktop.
function get_blog_post($where)
{
$this->db->where($where);
$query = $this->db->get(‘blog_posts’, 1);
if($query->num_rows() == 1)
{
return $query->row_array();
}
return FALSE;
}
function check_blog_title_exists($title)
{
$exists = $this->get_blog_post(array(‘title’ => $title));
if(!$exists)
{
return FALSE;
}
return TRUE;
}
function get_post_title_by_id($ID)
{
$post = $this->get_blog_post(array(‘ID’ => $ID));
if($blog)
{
return $post['title'];
}
return FALSE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment