This topic is locked

Mark Exported Records

3/3/2006 6:44:11 PM
PHPRunner General questions
S
stoneiii author

I am trying to mark records that have been exported by writing "exported" to a status field (varchar) . Can anyone out there help me with this? So far I have been able to use the events to mark all the records in the table, but can not figure out how to only mark the ones that have been exported. Thanks in advance for any help.

Sergey Kornilov admin 3/6/2006

Hi,
you can do this modifying generated ..._export.php file
To mark records exported to Excel modify WriteTableData function there.

Put your code just after this snippet:

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

{



Here is the sample code:

$updateSQL = "update mytable set status='exported' where ID=".$row["ID"];

db_exec($updateSQL,$conn);


where mytableis your table name, and IDis the key field in it.

Please note that field names are case-sensitive here.
When you get this to work modify ExportToXML and ExportToCSVfunctions the same way.

S
stoneiii author 3/7/2006

Another satisfied customer! This product is awesome and support is amazing. Thank you so much for your help.