This topic is locked

Setting a max limit on exporting

9/4/2006 10:22:22 AM
PHPRunner General questions
K
ke5rs author

Hello,

I would like to set a max limit to the number of records that can be exported from my database?

Something like
$MaxRecordsAllowed=10
if ($MaxRecordsFound >$ MaxRecordsAllowed)

$MaxRecordsFound=$MaxRecordsAllowed;
Thank you
John

A
andrewrnd 9/5/2006

Hello, John
You should edit generated ..._export.php file
Open it in text editor, go to WriteTableData function and locate the following code snippet:

// write data rows

$iNumberOfRows = 0;

while((!$nPageSize || $iNumberOfRows<$nPageSize) && $row=db_fetch_array($rs))


replace it with the following:

// write data rows

$iNumberOfRows = 0;

$MaxRecordsAllowed=10;

while( (!$nPageSize || $iNumberOfRows<$nPageSize) && ($row=db_fetch_array($rs)) && $iNumberOfRows<$MaxRecordsAllowed)


make the same for ExportToCSV and ExportToXML functions

K
ke5rs author 9/5/2006

Thank you Andrew

I see how the and's (&) work now.

Works great.

Thank you again...

John

Hello, John

You should edit generated ..._export.php file
Open it in text editor, go to WriteTableData function and locate the following code snippet:

// write data rows

$iNumberOfRows = 0;

while((!$nPageSize || $iNumberOfRows<$nPageSize) && $row=db_fetch_array($rs))


replace it with the following:

// write data rows

$iNumberOfRows = 0;

$MaxRecordsAllowed=10;

while( (!$nPageSize || $iNumberOfRows<$nPageSize) && ($row=db_fetch_array($rs)) && $iNumberOfRows<$MaxRecordsAllowed)


make the same for ExportToCSV and ExportToXML functions