In what ways does the mysqli_ extension differ from the mysql_ extension in PHP, besides the addition of the "i" at the end?

The mysqli_ extension in PHP is an improved version of the mysql_ extension, offering better security, support for prepared statements, and improved functionality for interacting with MySQL databases. One key difference is that mysqli_ supports object-oriented programming, while mysql_ does not. It is recommended to use the mysqli_ extension for new projects as the mysql_ extension is deprecated.

// Connect to MySQL database using mysqli_
$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";