is it possible to have a column displayed represented by a variable dependent on an 'if' clause
Code: |
function prepareQuery($query)
{
$db->setquery("SELECT column_x FROM table_x");
$VARIABLE = $db->loadresult();
if ($VARIABLE > 5){
$VARIABLE = "YES";
}
else {
$VARIABLE = "NO";
}
|
I would then define as usual
Code: |
$params = array(
'VARIABLE' => $VARIABLE
);
|
Then finally include this variable in a select statement in ARI data tables
Code: |
SELECT column_x,{$VARIABLE} AS STATUS
FROM table_x
|
I understand that $VARIBALE is an array but I would like the Select statement to loop through each value in column_x and display the resulting {$VARIABLE} dependent on the value of column_x
thanks
trevor