How can using deprecated MySQL functions in PHP impact the functionality and security of a web application?

Using deprecated MySQL functions in PHP can impact the functionality and security of a web application because these functions are no longer supported and may have vulnerabilities that can be exploited by attackers. To address this issue, it is recommended to switch to MySQLi or PDO for database operations, as they offer more secure and modern ways to interact with databases.

// Connect to MySQL using MySQLi
$mysqli = new mysqli('localhost', 'username', 'password', 'database');

// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " . $mysqli->connect_error);
}