<?php
require_once "config/connection.php";

$buyer_id = $_POST['buyer_id'];

$query = "SELECT mcp.id, mcp.code_color 
          FROM master_color_panel mcp
          WHERE mcp.buyer_id = $buyer_id
          ORDER BY mcp.code_color";

$result = mysqli_query($conn, $query);

echo '<option value="">All Colors</option>';
while ($row = mysqli_fetch_assoc($result)) {
    echo '<option value="' . $row['id'] . '">' . htmlspecialchars($row['code_color']) . '</option>';
}
?>