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

class Countymodel extends CI_Model {




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

      }


   else

   {

     return false;

   }


}
function getcountybyid($id){


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

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

   return $bioquery->result();
   


}else{

  return false;
}




}
   





function getspecificcountybyid($id){


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

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

   return $bioquery->result_array();
   


}else{

  return false;
}




}





   
 function populatecounty()
 

{


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

   {
  return $query1->result();

   }

   else

   {

     return false;

   }

}




}

 ?>