What are the potential pitfalls of using a two-file system for bilingual websites in PHP?

One potential pitfall of using a two-file system for bilingual websites in PHP is that it can become cumbersome to manage and update multiple language files. To solve this issue, you can consider using a database to store translations instead of separate files. This way, you can easily add, update, and delete translations without having to manually edit multiple files.

// Connect to database
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "translations";

$conn = new mysqli($servername, $username, $password, $dbname);

// Query database for translations
$sql = "SELECT * FROM translations WHERE language = 'en'";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    while($row = $result->fetch_assoc()) {
        $translations[$row['key']] = $row['value'];
    }
}