Welcome Guest, Not a member yet? Register   Sign In
it is not paginating me, humm, dunno why :(
#1

[eluser]number1chump[/eluser]
Hello


well the User guide, which I have thoroughly read several times, says pagination is straightforward. Yet, I dont know why I am not getting to make it. I have managed to display all of the 600 rows, but it is all in one page. I also managed to have the links (page 1, page 2 and upon clicking it just reloads again the 600 rows, so it does not separate them say in pages of 20 row display. I have tried all possible combinations, passing the extracting data from the Model to the Controller, and actually I manage to display the 600 rows without calling the View page. Maybe something in there is the key for failure, it seems as though View did not matter.

Here are the files

MODEL:

Code:
<?php

class Pilla_datos extends Model {
    
    
    
function Pilla_datos()
    {
        // Call the Model constructor
        parent::Model();
    }

        function damedatos ()
        
        {
            
        $this->load->database();  // LOADS THE CLASS DATABASE FROM THE CORE LIBRARY
    
    $query = $this->db->query('SELECT activity_provider, email FROM activity');
        
        foreach ($query->result() as $row)
        {
        echo $row->activity_provider;echo '<br>';
        echo $row->email;
        }

        echo 'Total Results: ' . $query ->num_rows();
    
          
        }

    
}              
                
     ?&gt;

CONTROLLER:

Code:
&lt;?php


class Datos_controller extends Controller {


        function Pilla_datos () {
  
    
  $this->load->model('Pilla_datos');  // IT LOADS THE MODEL
    
  $data =  $this->Pilla_datos->damedatos(); // IT GETS THE DATA FROM THE MODEL CALLING //THE FUNCTION INSIDE THE MODEL
   $this->load->library('pagination');//LOADS PAGINATION CLASS
   $config['base_url'] = 'http://localhost/site1/index.php/datos_controller/pilla_datos/';
   $config['total_rows'] = '200';
   $config['per_page'] = '20';

   $this->pagination->initialize($config);
   echo $this->pagination->create_links();//IT DOES ADD THE LINKS BUT RELOADS THE 600 ROWS
   $this->load->view('muestra_datos, $data');  // LOADS THE VIEW AND PASSES IT     //DYNAMICALLY THIS //DATA BUT ACTUALLY EVEN WITHOUT CALLING THE VIEW, THE ROWS ARE //DISPLAYED, THIS IS
//BECAUSE THEY ARE ALREADY ECHOED AT THE MODEL
    
                }  
            
    }

?&gt;


Messages In This Thread
it is not paginating me, humm, dunno why :( - by El Forum - 01-11-2011, 05:35 AM
it is not paginating me, humm, dunno why :( - by El Forum - 01-11-2011, 06:08 AM
it is not paginating me, humm, dunno why :( - by El Forum - 01-11-2011, 06:26 AM
it is not paginating me, humm, dunno why :( - by El Forum - 01-11-2011, 10:19 AM
it is not paginating me, humm, dunno why :( - by El Forum - 01-11-2011, 12:58 PM
it is not paginating me, humm, dunno why :( - by El Forum - 01-11-2011, 01:14 PM
it is not paginating me, humm, dunno why :( - by El Forum - 01-11-2011, 01:25 PM
it is not paginating me, humm, dunno why :( - by El Forum - 01-11-2011, 01:46 PM
it is not paginating me, humm, dunno why :( - by El Forum - 01-11-2011, 02:19 PM
it is not paginating me, humm, dunno why :( - by El Forum - 01-12-2011, 10:39 AM
it is not paginating me, humm, dunno why :( - by El Forum - 01-22-2011, 03:39 PM
it is not paginating me, humm, dunno why :( - by El Forum - 01-23-2011, 05:04 AM
it is not paginating me, humm, dunno why :( - by El Forum - 01-30-2011, 04:20 PM
it is not paginating me, humm, dunno why :( - by El Forum - 01-30-2011, 06:58 PM
it is not paginating me, humm, dunno why :( - by El Forum - 01-31-2011, 12:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB