Page 1 of 1

Question about variables and curly brackets

Posted: 2019-05-12 07:56
by kevinm
I see from the examples in the support pages that some variables are enclosed in curly brackets, and some aren't. Is there a particular reason for this?

e.g $item_balance = sqlValue("select
sum(if(transaction_type in ({$positive_transactions}), quantity, -1 * quantity))
from transactions where item={$item}
");

and

if($memberInfo['group']!='Admins'){
$id=makeSafe($SelectedID);
$approved=sqlValue("select `approved` from `tablename` where `id`='$id'");

// if the record is approved, don't allow deleting it
if($approved) return FALSE;
}