What potential issues could arise from using the mysql_connect function in PHP for database connections?

One potential issue with using the mysql_connect function in PHP is that it is deprecated as of PHP 5.5.0 and removed in PHP 7.0.0. It is recommended to use the mysqli or PDO extension for connecting to MySQL databases instead. This will ensure compatibility with newer PHP versions and provide better security features.

// Using mysqli extension for database connection
$mysqli = new mysqli("localhost", "username", "password", "database_name");

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