<?php
class m_ajax extends CI_MODEL
{
  
function getSubject()
{
   $this->db->select('Subject_ID,Subject');
   $this->db->from('subject');
   $this->db->order_by('Subject', 'asc');
   $query=$this->db->get();
   return $query;
}

function getData($loadType,$loadId)
{
   if($loadType=="question"){
    $fieldList='Aquestion_ID,Question as name';
    $table='aquestion';
    $fieldName='Subject_ID';
    $orderByField='Question';
   /*}else{
    $fieldList='id,city_name as name';
    $table='city';
    $fieldName='state_id';
    $orderByField='city_name';
   }*/
   $this->db->select($fieldList);
   $this->db->from($table);
   $this->db->where($fieldName, $loadId);
   $this->db->order_by($orderByField, 'asc');
   $query=$this->db->get();
   return $query;
 }