File: /home/barbeatleanalyti/www/mbaris.beatleanalytics.com/application/models/Beatle_survey2_model.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Beatle_survey2_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
public function get_all()
{
$query = $this->db->get('beatle_survey2');
return $query->result_array();
}
public function get_by_id($id)
{
$query = $this->db->get_where('beatle_survey2', array('surveyId' => $id));
return $query->row_array();
}
public function insert($data)
{
return $this->db->insert('beatle_survey2', $data);
}
public function update($id, $data)
{
$this->db->where('surveyId', $id);
return $this->db->update('beatle_survey2', $data);
}
public function delete($id)
{
return $this->db->delete('beatle_survey2', array('surveyId' => $id));
}
}