This code below currently just rotate flags to load different templates based on count. But I want to make use flag 1 for Sell if its not null or otherwise Flag 2 for Buy ?
How I can do that?
$content = '';
$flag = 1;
while ($row = $db->doRead())
{
$content .= Template::Load('market-' . $flag++,
array
(
'name' => $row['UserID'],
'buy' => $row['Buy'],
'sell' => $row['Sell'],
'Item' => $row['Item'],
'Item2' => $row['Item2']
)
);
if ($flag > 2) $flag = 1;
}