Wrote a function below to search the products (custom search). It is returning me all the valid records.... No problems at all. Want to introduce pagination. Would somebody help please.
function ProductSearch() {
global $databaseConfig;
$query = new SQLQuery();
$query->select = array(
"Title",
"Content",
"URLSegment"
);
$query->from("xx_xxx");
$query->where("ShowInSearch = 1 AND ClassName = 'Product' AND Title LIKE '%" . mysql_real_escape_string($srchProduct)");
$query->orderby("Title ASC, ID ASC");
$result = $query->execute();
$plist = new DataObjectSet();
foreach($result as $DataRow) {
$plist->push(new ArrayData($DataRow));
}
} else {
$plist = NULL;
}
return $plist;
}