This topic is locked

How do I create a row count column?

9/10/2007 7:09:03 AM
PHPRunner General questions
P
pjeaton author

Hello,
I am creating some pages from MS Access tables. I need to create a column in the output that shows a record number of the row from the underlying recordset. This is a problem in MS Access datasets as it doesn't provide a record count natively.
For some of my tables I have been able to add a dynamic record count by adding a counter subselect in the underlying query - it's inefficient but it works.
However, for one of my tables, I can't do this as it's the output from a crosstab table and you can't have subselects with those. Even worse, you can't join it with another table that has any subselects in it either!
Has anyone managed to get round this problem?
I guess one way to do it would be to modify the php that PHPR creates. Anyone have any experience in doing this?
Another way round it is to copy the results of the crosstab query into a static table, but that's very messy and I'd prefer not to do it that way.
Thanks for your time.
Phillip Eaton

London, UK

P
pjeaton author 9/10/2007

I've sussed it...quite easy really.
I added a dummy 'position' record counter to my query and then wrote a post-build sed script to change the PHP file:

From

$row[$col."Position_value"]=$value;

To

$row[$col."Position_value"]=($mypage-1)*$PageSize+$recno;
Cheers,

Phillip Eaton