This topic is locked

GetRowCount Event

1/5/2011 6:49:09 PM
PHPRunner General questions
D
Dale author

How do I use this to get the number of records from the page.

I need to get the number of total records $maxRecords into a variable to display on a tab.

in earlier versions in the Before Display list I would just make $numrows global and away I go.

This doesnt work in 5.3

I see that Get Row Count but I unfortunately not savy enough to figure it out.

I have a table Project and I have added an addwhere clause in the before SQL Query event.

I have checked the help but there is no sample of code on how to make it work.

What am I missing to simply get the $maxRecords count into a variable. I have tried to make $maxRecords global in the before show list event.

Sergey Kornilov admin 1/6/2011

The purpose of GetRowCount event is to perform your own row count calculation. If you need to perform some complicated filtering, GetRowCount is the placed where you calculated the current number of records and return it.
Since number of records variable appears in Visual Editor as "records_found" you can use the following BeforeDisplay event:

echo $xt->getvar("records_found");
D
Dale author 1/6/2011

Thanks Sergey, I will try this out this morning.