// Create a connection $conn = mysqli_connect("localhost", "username", "password", "database_name"); // Check if the connection is successful if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } // Perform queries $sql = "SELECT * FROM users"; $result = mysqli_query($conn, $sql); // Close the connection mysqli_close($conn);In this example, we create a connection to the database using the `mysqli_connect()` function, passing in the hostname, username, password, and database name as arguments. We then check if the connection is successful using the `mysqli_connect_error()` function. We can then execute queries on the database using the `mysqli_query()` function, passing in the connection and the SQL query as arguments. Finally, we close the connection using the `mysqli_close()` function. The package library used in this example is the MySQLi extension for PHP.