<?php
define('DB_HOST', 'localhost');
define('DB_NAME', 'xml');
define('DB_USER', 'root');
define('DB_PASS', '');

$pdo = new PDO("mysql:host=" . DB_HOST . ";dbname=" . DB_NAME . ";charset=utf8mb4", DB_USER, DB_PASS);
        

 $stmt = new PDO('mysql:host=localhost;dbname=xml','root', '');
 // $query = "SET NAMES utf8;"
 /*
 $stmt = $pdo->prepare("
                SELECT * 
                FROM item 
                WHERE product_id = 54
            ");
            $stmt->execute();
            $object = $stmt->fetch();
*/
      ?>
	  <table>
<?php
/*
			echo "<td> $object[description]; </td>";
			echo "<img src='$object[image]' height='50px' width='50px'>";
			echo "<td> $object[price]</td>";
			echo " лв/бр.";
  */
 	?>
	</table>
<?php	

$stmt = $pdo->prepare("SELECT * FROM item WHERE manufacturer like 'HIKVISION' ORDER BY product_id");
$stmt->execute();
$items = $stmt->fetchAll();

$stmt = $pdo->prepare("SELECT product_category FROM item WHERE 1 GROUP BY product_category ORDER by product_category ASC");
$stmt->execute();
$cats = $stmt->fetchAll();

?>
	 <div class="mb-3">
                        <label class="form-label">Категория *</label>
                        <select class="form-select" name="object_id" required>
                            <option value="">Изберете...</option>
                            <?php foreach ($cats as $cat): ?>
                            <option value="<?= $cat['product_id'] ?>">
								<?= htmlspecialchars($cat['product_category']) ?>
							 </option>
                            <?php endforeach; ?>
                        </select>
                    </div>
                    </br>
					</br>
					
	 <div class="mb-3">
                        <label class="form-label">Артикули *</label>
                        <select class="form-select" name="object_id" required>
                            <option value="">Изберете артикул...</option>
                            <?php foreach ($items as $item): ?>
                            <option value="<?= $item['product_id'] ?>">
 <?=
 $a = ($item['price']);
 $b = '1.25';
 $c = ($a * $b);
?>
							<?= htmlspecialchars($item['model']) ?>  --- <?= htmlspecialchars($item['product_category']) ?>  >  <?= htmlspecialchars($item['name']) ?> -  <?= htmlspecialchars($c) ?> лв.
							 </option>
                            <?php endforeach; ?>
                        </select>
                    </div>
                    