Skip to content

Instantly share code, notes, and snippets.

@seanmcn
Last active August 29, 2015 14:10
Show Gist options
  • Save seanmcn/a11585c45d72f2df1faf to your computer and use it in GitHub Desktop.
Save seanmcn/a11585c45d72f2df1faf to your computer and use it in GitHub Desktop.
Using Codeigniter's ActiveRecord
/*
* Model for Projects
*/
function addProject($client, $projectName, $price, $deadline, $notes) {
$project = array(
"client_id" => $client,
"user_id" => $this->session->userdata('user_id'),
"name" => $projectName,
"price" => $price,
"deadline" => $deadline,
"notes" => $notes,
"active" => 1
);
$this->db->insert('projects', $project);
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment