Fix another notice

feature/node-rewrite
Sven Slootweg 12 years ago
parent b702923505
commit 236f5d2c4d

@ -172,18 +172,23 @@ foreach($result->data as $row)
);
}
$result = $database->CachedQuery("SELECT * FROM templates WHERE `Available` = 1");
$sTemplates = array();
foreach($result->data as $row)
if($result = $database->CachedQuery("SELECT * FROM templates WHERE `Available` = 1"))
{
$sTemplate = new Template($row);
$sTemplates[] = array(
'id' => $sTemplate->sId,
'name' => $sTemplate->sName
);
foreach($result->data as $row)
{
$sTemplate = new Template($row);
$sTemplates[] = array(
'id' => $sTemplate->sId,
'name' => $sTemplate->sName
);
}
}
else
{
/* TODO: Show an error when no templates are available. */
}
$result = $database->CachedQuery("SELECT * FROM users WHERE `AccessLevel` > 0");

Loading…
Cancel
Save