Welcome Guest, Not a member yet? Register   Sign In
Search and Pagination - Error
#1

[eluser]Unknown[/eluser]
Hi,
I try to search in my system library system search by author,book name.And i wrote these codes for searching .

Controller
Code:
function searchbyauthor()
    {
        $this->load->view('front/front_searchbyauthor');
    }

    function searchbyauthor_do()
    {
        $this->load->model('front/search_model');
        $data['show'] = $this->search_model->searchbyauthors_do();
        $this->load->view('front\front_searchbyauthorlist',$data);
    }

Model
Code:
<?php
class search_model extends Model {

    var $author_name = ' ';

    function search_model()
    {
        parent::Model();    
        $this->load->helper('date');
    }

    function searchbyauthors_do()
    {
        $this->db->like('author_name', $_POST['author_name'], 'both');
        $query = $this->db->get('authors');
        return $query->result();
    }    

}

View
Code:
&lt;!--[if !IE]>start row<![endif]--&gt;
                                <div class="row">
                                    <label>Auhtor Name :</label>
                                    <div class="inputs">
                                        <span class="input_wrapper">&lt;input class="text" name="author_name" type="text" /&gt;&lt;/span>
                                    </div>
                                </div>
                                &lt;!--[if !IE]>end row<![endif]--&gt;

And button
Code:
<span class="button blue_button search_button"><span><span>Search for Me</span></span>&lt;input name="" type="submit" /&gt;&lt;/span>

It's working correctly but i cant added pagination into that system.How can i add or config search result ll be in pagination page.

Thanks,sorry for English Sad


Messages In This Thread
Search and Pagination - Error - by El Forum - 08-21-2009, 07:44 AM
Search and Pagination - Error - by El Forum - 08-21-2009, 01:52 PM
Search and Pagination - Error - by El Forum - 09-03-2009, 01:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB