Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created March 20, 2018 22: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 parzibyte/27a4ecdcc3867744ec8d2aa9467402ae to your computer and use it in GitHub Desktop.
Save parzibyte/27a4ecdcc3867744ec8d2aa9467402ae to your computer and use it in GitHub Desktop.
<?php
class Persona_model extends CI_Model{
function __construct()
{
$this->load->database();
}
public function nueva($persona){
$this->db->insert("personas", [
"nombre" => $persona->nombre,
"edad" => $persona->edad,
]);
return $this->db->insert_id();
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment