prepare("SELECT p.*, c.name as cat_name FROM products p JOIN categories c ON p.category_id = c.id WHERE p.name LIKE ? OR p.description LIKE ? OR c.name LIKE ? ORDER BY p.id DESC"); $stmt->execute(['%'.$q.'%', '%'.$q.'%', '%'.$q.'%']); $results = $stmt->fetchAll(); } ?>
关键词: ""