<?php
require_once 'db/config.php';
$q = 'Tomato';
$searchTerm = "%$q%";
$stmt = db()->prepare("SELECT * FROM stock_items WHERE name_en LIKE ? OR name_ar LIKE ? OR sku LIKE ? LIMIT 15");
$stmt->execute([$searchTerm, $searchTerm, $searchTerm]);
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
echo "Results for Tomato: " . count($results) . "\n";
print_r($results);

$q = 'INV-00001';
$searchTerm = "%$q%";
$stmt->execute([$searchTerm, $searchTerm, $searchTerm]);
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
echo "Results for INV-00001: " . count($results) . "\n";
