<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Provincemodel extends CI_Model {





function addnewprovince($data)
{
// Query to insert data in database
  //$regnumber = $data['regnumber'];
  
    $this->db->insert('province', $data);
  if ($this->db->affected_rows() > 0) 
      {
  return true;

      }


   else

   {

     return false;

   }


}


function getprovincebyid($id){


$this->db->select(" * from  province where id= '$id'");

 $this->db->order_by('id');
$bioquery = $this -> db -> get();
if($bioquery->num_rows()>0){

   return $bioquery->result();
   


}else{

  return false;
}




}








       function populateprovince()
 

{


   $query1 = $this->db->get('province');
       
 if($query1 -> num_rows() >0)

   {
  return $query1->result();

   }

   else

   {

     return false;

   }
   }
   
   }
   
    ?>