<?php
$my_search = new Search();
$order_column = "column1";
$order_type = "desc";
$offset = 100;
$limit = 150;
$my_search->set_table_name('my_table');
$my_search->set_terms("search term");
$my_search->set_fields(array('column1','column2','column3',));
$my_search->set_filters(array('column5'=>array('filter1','filter2')));
$my_search->set_match_case(false);
$my_search->get_query($order_column,$order_type,$offset,$limit);
/* Above line returns:
SELECT *
FROM my_table
WHERE (column1 LIKE '%search%term%' OR column2 LIKE '%search%term%' OR column3 LIKE '%search%term%')
AND (column5 IN ('filter1','filter2'))
ORDER BY column1 desc
LIMIT 100,150
*/
|