it is not paginating me, humm, dunno why :(

#11
[eluser]number1chump[/eluser]
[quote author="Josh Holloway" date="1294784343"]


Hello Josh,


I will probably be wrong, but so far I dont know why I am not right. This is:

the file name of the model will be a lower case version of the class name. Your class name was Articles_model, so the model should be like that but in lower case articles_model


then when you load the Model from the controller, why are you naming it posts_model ? shouldnt you be loading it by the class name of the model, namely Articles_model ?

Aside from that, the closing curly brackets of the class were missing in both files.

#12
[eluser]number1chump[/eluser]
Hello again


well I tried to implement your code and I got a series of errors saying that there was call function on a non-object. Also that there was an undefined property.

So then I copied and pasted your code and changed only the name of the table. But I still got the same error after copying and pasting your code. So, I dont know ...


Severity: Notice

Message: Undefined property: Posts::$Posts_model

Filename: controllers/posts.php

Line Number: 16

Fatal error: Call to a member function count_posts() on a non-object in C:\xampp\htdocs\site1\system\application\controllers\posts.php on line 16

Actually that doesnt surprise me much because I dont see how a count_all_results directed to a table name could count what. In this case it is a simple query so it is referred to the full table yes, but if there is a condition, then the count_all_results could not refer to just the table name, the results would be less than all the rows.


I am not seeing either that the pagination library has been loaded in your example

#13
[eluser]Josh Holloway[/eluser]
Quote:then when you load the Model from the controller, why are you naming it posts_model ? shouldnt you be loading it by the class name of the model, namely Articles_model ?

I mocked this up from a articles model I used. - I've corrected this now!

Quote:Aside from that, the closing curly brackets of the class were missing in both files.

Yes, because they were snippets. If you're going to get picky I've now added the end curly brackets so you can copy and paste without hurting yourself

Quote:Severity: Notice

Message: Undefined property: Posts::$Posts_model

Filename: controllers/posts.php

Line Number: 16

Is because of the model being called Articles_model as opposed to Posts_model.

Try now it should work!

#14
[eluser]Ihms[/eluser]
Man!! halleluja.

I have been sitting with a pageination problem for a couple of weeks. This solves it.
Thanks

#15
[eluser]number1chump[/eluser]
[quote author="Ihms" date="1296457131"]Man!! halleluja.

I have been sitting with a pageination problem for a couple of weeks. This solves it.
Thanks[/quote] Good! as per your signature, the perfect child care center is his own familily
=======================


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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