<?php
	

class StudentModel extends CI_Model {

public function insert_data($data_array,$table){
$this->db->insert($table,$data_array);
return $this->db->insert_id();    
}

public function updaterecords($Student_name,$course_name,$father_name,$student_address,$student_email,$mobile_no,$id)
	{
	$query=$this->db->query("update student SET student_name='$Student_name',class='$course_name',father_name='$father_name',address='$student_address',email='$student_email',contact_no='$mobile_no' where id='".$id."'");
	}


public function get_data($school_id,$table){
$info=array();
$this->db->select('*');
$this->db->from($table);
$this->db->where('school_id',$school_id);
$info=$this->db->get()->result_array();
return $info; 
}

public function get_data_by_id($student_id,$table){
$info=array();
$this->db->select('*');
$this->db->from($table);
$this->db->where('id',$student_id);
$info=$this->db->get()->result_array();
return $info; 
}
}