Created
July 5, 2010 05:59
-
-
Save tomschlick/464053 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
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