Hello, I have been working on improving myself in PHP by performing XML data insertion and data update operations. However, I am not encountering errors but instead getting a blank screen. Esteemed experts, could you please check my code and guide me? I would greatly appreciate it if you return with a working code to help me identify any mistakes I may have missed. Thank you.
index.php file:
```php
include("config.php");
$file = simplexml_load_file("musteri.xml");
foreach ($file as $key => $value) {
$musteriID = $value->id;
$musteriAdi = $value->adi;
$musteriSoyadi = $value->soyadi;
$musteriMeslek = $value->meslek;
$musteriYasi = $value->yas;
$control = $db->prepare("SELECT * FROM musteriler WHERE musteriID=?'$musteriID'");
$control->execute(array($musteriID));
$say = $control->rowCount();
if ($say == 0) {
$veriler = $control->fetchAll(PDO::FETCH_ASSOC);
foreach ($veriler as $veri) {
$sql = $db->prepare("UPDATE musteriler SET musteriAdi=?,musteriSoyadi=?,musteriMeslek=?musteriYasi=? WHERE musteriID=?");
$sql->execute(array($musteriAdi, $musteriSoyadi, $musteriMeslek, $musteriYasi["musteriID"]));
if ($sql->rowCount() > 0) {
echo "Update successful";
} else {
echo "Error occurred";
}
}
} else {
$sql = $db->prepare("INSERT INTO musteriler SET musteriID=?,musteriAdi=?,musteriSoyadi=?,musteriMeslek=?musteriYasi=? ");
$sql->execute([$musteriAdi, $musteriSoyadi, $musteriMeslek, $musteriYasi]);
if ($sql->rowCount() > 0) {
echo "Record successful";
$file = file_get_contents("$resim");
$kayit = fopen('images/' . $resim_yol, "w+");
fwrite($kayit, $veri2);
fclose($kayit);
}
}
}
echo "";
```
config.php file:
```php
try {
$db = new PDO("mysql:host=localhost;dbname=erdal", "root", "");
} catch (PDOException $e) {
print $e->getMessage();
}
```
XML file:
```
1 Mert Buldur Orman Müh. 21
2 Mustafa Y?ld?z Avukat 30
```
index.php file:
```php
include("config.php");
$file = simplexml_load_file("musteri.xml");
foreach ($file as $key => $value) {
$musteriID = $value->id;
$musteriAdi = $value->adi;
$musteriSoyadi = $value->soyadi;
$musteriMeslek = $value->meslek;
$musteriYasi = $value->yas;
$control = $db->prepare("SELECT * FROM musteriler WHERE musteriID=?'$musteriID'");
$control->execute(array($musteriID));
$say = $control->rowCount();
if ($say == 0) {
$veriler = $control->fetchAll(PDO::FETCH_ASSOC);
foreach ($veriler as $veri) {
$sql = $db->prepare("UPDATE musteriler SET musteriAdi=?,musteriSoyadi=?,musteriMeslek=?musteriYasi=? WHERE musteriID=?");
$sql->execute(array($musteriAdi, $musteriSoyadi, $musteriMeslek, $musteriYasi["musteriID"]));
if ($sql->rowCount() > 0) {
echo "Update successful";
} else {
echo "Error occurred";
}
}
} else {
$sql = $db->prepare("INSERT INTO musteriler SET musteriID=?,musteriAdi=?,musteriSoyadi=?,musteriMeslek=?musteriYasi=? ");
$sql->execute([$musteriAdi, $musteriSoyadi, $musteriMeslek, $musteriYasi]);
if ($sql->rowCount() > 0) {
echo "Record successful";
$file = file_get_contents("$resim");
$kayit = fopen('images/' . $resim_yol, "w+");
fwrite($kayit, $veri2);
fclose($kayit);
}
}
}
echo "";
```
config.php file:
```php
try {
$db = new PDO("mysql:host=localhost;dbname=erdal", "root", "");
} catch (PDOException $e) {
print $e->getMessage();
}
```
XML file:
```
1 Mert Buldur Orman Müh. 21
2 Mustafa Y?ld?z Avukat 30
```