This topic is locked

Export Update Table

6/17/2009 8:50:43 AM
PHPRunner General questions
C
christwigg74 author

Hi all
I'm trying to update a field Exported to"1" when i perform an export (just for that record or multiple selected)
i've tried various update query's in the export page events but unable to get it to work.
Any ideas ?
Many thanks
global $conn;

$strUpdate = "

UPDATE tbl_Import

SET Exported = 1

WHERE ImportID = '".$values["ImportID"]."')";

db_exec($strUpdate,$conn);
I'm getting a Undefined variable: values Error on the Export Page

C
christwigg74 author 6/17/2009

Hi all
Just sorted this issue adding an event on export page before sql query
global $conn;

$strUpdate = "update mytable set Exported = 1 where (".$strWhereClause.")";

db_exec($strUpdate,$conn);
but i'm still having problems.
I have a sql query which only shows fields "Exported as 0" (default NULL)
because the query is before sql query it's contents are empty in the export page

C
christwigg74 author 6/18/2009

Solved the problem by using a list page:Before sql query
$strWhereClause = whereAdd($strWhereClause,"Exported=0");