Exclude keyword from search results

Still not working.

I plugged into the search results template the following:

list($productsRecords, $productsMetaData) = getRecords(array( 'tableName' => 'products', 'perPage' => '10', 'where' => "name != 'miele'", ));

However, Miele products keeps showing up in the results. Am I placing the code in the correct page?

Re: [waterdancer] Exclude keyword from search results

By Jason - August 23, 2011

Hi,

I took a look and I think I found the problem. Since the Miele is only part of the name, and not the entire name, we need to use the MySQL LIKE function. I changed the query to this:

list($productsRecords, $productsMetaData) = getRecords(array(
'tableName' => 'products',
'perPage' => '10',
'where' => "name NOT LIKE 'miele%'",
));


This seems to be working now.

Hope this helps,
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/