<?php
require_once 'conexion2.php';
if (isset($_POST['query'])) {
  $query = trim($_POST['query']);
  $stmt = $pdo->prepare("SELECT customer_id, customer_name FROM customers WHERE customer_name LIKE ? LIMIT 10");
  $stmt->execute(["%$query%"]);
  while ($row = $stmt->fetch()) {
    echo "<a href='#' class='list-group-item list-group-item-action cliente-item' data-id='{$row['customer_id']}'>{$row['customer_name']}</a>";
  }
}
