What version compatibility issues might arise when using PHP 5.0.2 with MySQL 4.0.21, as mentioned in the forum discussion?

When using PHP 5.0.2 with MySQL 4.0.21, version compatibility issues may arise due to potential deprecated features or changes in functionality between the two versions. To solve this issue, it is recommended to upgrade either PHP or MySQL to versions that are more closely aligned in terms of compatibility.

// Example code snippet to connect to MySQL database using PHP 5.0.2
$servername = "localhost";
$username = "username";
$password = "password";
$database = "dbname";

// Create connection
$conn = mysqli_connect($servername, $username, $password, $database);

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