#1 July 17, 2020 12:46am

StevenShelby
Member
Registered: July 17, 2020
Posts: 1

Need help

I've tried using the search function but it does not return anything. I must be using it wrong:

$search_string="SELECT * FROM products WHERE name LIKE '%{$search_item}%'";
$products=$productsMod->search($search_string,false,false,false,false,false);

How should i structure my query string?

Offline

#2 July 17, 2020 9:01am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 905

Re: Need help

The search method on a module class accepts the search term as the first parameter (in your case it looks like $search_item contains that data). You don't need to pass in a full SQL query.

$products=$productsMod->search($search_item);

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.