Get the values from a SQL statement within an ADDT trigger that do not exist within the original transaction.
$querySEL = "SELECT dbfield1, dbfield2 FROM table";
$result = $tNG->connection->execute($querySEL);
$numberOfRecords = $result->recordCount();
......
while (!$result->EOF)
{
$result->Fields('dbfield1');
$result->Fields('dbfield2');
$result->MoveNext();
}
}
-----
So the important functions are $result->EOF which indicates you perused all records. To retrieve a column from the current row use $result->Fields('>>>fieldname<<<')
To get to the next row, use $result->MoveNext(). There is also a MoveFirst function, just in case you need to read all rows again.
Retrieving Values from SQL Select in a Trigger
Re: Retrieving Values from SQL Select in a Trigger
Also you can get db value for use in a custom trigger like so.
$Value = $tNG->getColumnValue("Field from database");
It must be a part of the original transaction though.
This is also already in ADDT/Interakt Docs
$Value = $tNG->getColumnValue("Field from database");
It must be a part of the original transaction though.
This is also already in ADDT/Interakt Docs
Re: Retrieving Values from SQL Select in a Trigger
Hi FlyOTW,
Would you post an article about this on the main site please?
Even if it is ADDT/Interakt Docs
Thanks
Would you post an article about this on the main site please?
Even if it is ADDT/Interakt Docs
Thanks