• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search and Pagination - Error

I try to search in my system library system search by author,book name.And i wrote these codes for searching .

function searchbyauthor()

    function searchbyauthor_do()
        $data['show'] = $this->search_model->searchbyauthors_do();

class search_model extends Model {

    var $author_name = ' ';

    function search_model()

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


&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>
                                &lt;!--[if !IE]>end row<![endif]--&gt;

And button
<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

Since clicking on a pagination link will load another page and thus lose your search post, you need to somehow pass the original search string back to the page along with the new page number. You can either store the search string in a session or cookie variable when the original search is made or you can add the search string as a parameter to the url you are navigating to (?search=book). Every one of your pagination links must have this parameter in order for it to work.

Thanks alot.
It works now =)

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.