Ticket #21 (assigned defect)

Opened 6 years ago

Last modified 6 years ago

Paging doesn't work for me - static variables missing

Reported by: walt Owned by: walt
Priority: high Milestone:
Component: Active Record Version:
Severity: major Keywords:
Cc:

Description

These variables are missing in active_record.php and I got an error when paging was set in find_all:

public static $rows_per_page;
public static $page;
public static $pages;
public static $offset;

Change History

Changed 6 years ago by Alderete

I could not get paging to work either, using r197. I tried adding the declarations of static variables which you describe, and that was not enough.

I did in the end get paging to work for me, but ended up having to re-write the two HTML-emitting methods, and fixing a couple defects in find_all(). I described the required changes in the forums, in a post titled  How do you implement paging. The description of the fixes is the last post, after the questions.

Changed 6 years ago by Walt

  • owner changed from somebody to Walt

Another interesting wrinkle is that when you provide a $limit argument to find_all(), the result is that two calls are made to query() - one with, and one without, the LIMIT keyword in the SQL.

Actually it isn't clear to me that there is a large benefit to doing paging in ActiveRecord? since the DBMS needs to find all the rows anyway, and paging consists of selecting some subset to actually read into memory.

Changed 6 years ago by walt

  • owner changed from Walt to walt

Changed 6 years ago by walt

  • status changed from new to assigned

Changed 6 years ago by john

  • summary changed from smart+question to Paging doesn't work for me - static variables missing
  • type changed from spam to defect
  • reporter changed from maciej to walt
Note: See TracTickets for help on using tickets.