What are the potential pitfalls of using the mysql_* functions in PHP, especially in comparison to mysqli_* functions?

Using the mysql_* functions in PHP is not recommended as they are deprecated and no longer maintained. This can lead to security vulnerabilities and compatibility issues with newer versions of PHP. It is recommended to use mysqli_* functions or PDO for database interactions in PHP.

// Using mysqli_* functions to connect to a database
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "database";

$conn = mysqli_connect($servername, $username, $password, $dbname);

if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}