Skip to content

Instantly share code, notes, and snippets.

@tony1223
Created October 16, 2012 16:14
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 tony1223/3900290 to your computer and use it in GitHub Desktop.
Save tony1223/3900290 to your computer and use it in GitHub Desktop.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class ArticleModel extends CI_Model {
function __construct()
{
parent::__construct();
}
function insert($author,$title,$content){
$this->db->insert("article",
Array(
"Author" => $author,
"Title" => $title,
"Content" => $content,
"Views" => 0,
));
return $this->db->insert_id() ;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment