setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); echo "✓ Database connection successful\n"; } catch(PDOException $e) { die("✗ Database connection failed: " . $e->getMessage() . "\n"); } // Array of configurations to add $configs = [ ['new_layout', '1', 'backend: enable/disable new layout menu'], ['short_module', '1', 'backend: enable/disable video shorts'], ['short_uploads', '1', 'backend: enable/disable video shorts uploads'], ['channel_memberships', '0', 'backend: enable/disable channel memberships'], ['member_chat_only', '0', 'backend: enable/disable member-only chat'], ['member_badges', '0', 'backend: enable/disable member badges'] ]; echo "\nAdding missing configurations...\n"; foreach ($configs as $config) { try { $stmt = $pdo->prepare("INSERT IGNORE INTO `db_settings` (`cfg_name`, `cfg_data`, `cfg_info`) VALUES (?, ?, ?)"); $result = $stmt->execute($config); // Check if the row was actually inserted $check = $pdo->prepare("SELECT COUNT(*) FROM `db_settings` WHERE `cfg_name` = ?"); $check->execute([$config[0]]); $exists = $check->fetchColumn(); if ($exists > 0) { echo "✓ Configuration '{$config[0]}' is now available\n"; } else { echo "✗ Failed to add configuration '{$config[0]}'\n"; } } catch(PDOException $e) { echo "✗ Error adding '{$config[0]}': " . $e->getMessage() . "\n"; } } echo "\n✓ Database configuration fix completed!\n"; echo "\nYou can now access the control panel.\n"; ?>