Why not use it by assigning it to a variable & keep it simple. Also use isset
along with to make sure it really exist,
$key = $directory[$i]['databaseName'];
if (isset($results[$key]) && $results[$key] == 1) {
echo '<input type="checkbox" checked> ' . $directory[$i]['linkName'];
}
else{
echo '<input type="checkbox"> ' . $directory[$i]['linkName'];
}
DEMO.