What are some potential pitfalls of using mysql_* functions in PHP?

Using mysql_* functions in PHP is not recommended as they are deprecated and have been removed in newer versions of PHP. This can lead to security vulnerabilities and compatibility issues with newer versions of PHP. It is recommended to use mysqli or PDO for database operations in PHP.

// Example of using mysqli functions to connect to a MySQL database
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "database";

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

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";