ajax live search table generation using codeigniter

Today, We want to share with you ajax live search table generation using codeigniter.In this post we will show you ajax pagination in codeigniter example demo, hear for dropdown search filter in codeigniter we will give you demo and example for implement.In this post, we will learn about Ajax Pagination with Search and Filter in CodeIgniter with an example.

ajax live search table generation using codeigniter

There are the Following The simple About search option in codeigniter Full Information With Example and source code.

As I will cover this Post with live Working example to develop search data from database in codeigniter using ajax, so the how to search and display data from database in codeigniter using ajax is used for this example is following below.

Live Data Search in Codeigniter using Ajax JQuery

The Simple jquery source code is given below


The complete HTML with jquery source code for input view is given below

Doctor information will be listed here...

And then the simple server side source code for output view


                   
'; foreach ($doctortable as $objects) { $outputdata .= ' '; // echo $outputdata; } $outputtail .= '
Doctor No Doctor Name Hospital Charge
'.$objects->DOCTORID.' '.$objects->TITLE.' '.$objects->HOSPITAL.' '.$objects->CHARGE.'
'; echo $output; echo $outputdata; echo $outputtail; } else { echo 'Any Data Not Found'; }

The home controller code is given below

 public function ajaxsearch()
    {
      
       if(is_null($this->input->get('id')))
        {
          $this->load->view('input');    
        }
        else
        {
          $this->load->model('Doctormodel'); 
          $data['doctortable']=$this->Doctormodel->doctortable($this->input->get('id')); 
          $this->load->view('output',$data);
        }
    }

The function source code for doctortable function in Doctormodel is given below

function doctortable($search){

        $query = $this
                ->db
                ->select('*')
                ->from('doctor')
                ->like('TITLE',$search)
                ->or_like('HOSPITAL',$search)
                ->get();
     
        if($query->num_rows()>0)
        {
            return $query->result(); 
        }
        else
        {
            return null;
        }
    
}

Web Programming Tutorials Example with Demo

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Live Search Using Jquery Ajax, Php Codeigniter and Mysql.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment