foreach ($words as $word) {
if (!isset($wordToId[$word]))
$rowsToAdd[] = array($word);
}
$database = Database::openConnection();
$database->prepare("INSERT IGNORE INTO words (word) VALUES (:word)");
$database->bindValue(':word', $word);
$database->execute();