<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "optikler";

// bağlantı oluşturuyoruz
$conn = new mysqli($servername, $username, $password, $dbname);

$sql = "SELECT * FROM oc_product_description";
$result = $conn->query($sql);
?>

<?php header('Content-type: application/xml; ',true); ?>



<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">

<?php while($row = $result->fetch_assoc()) { ?>

<url>
<name><?php echo ''.$row["product_id"]; ?></name>

<link><?php echo 'https://www.optikler.com/index.php?route=product/product&amp;product_id='.$row["product_id"]; ?></link>
</url>

<?php } ?>



</urlset>


olmadıı