This is kind a advanced problem that I cannot solve since I am not that good with SQL syntax...
My problem is that I want to perform a search in the entire object so I did like you said:
Code:
//Check if Search data is sent
if($this->input->post('sSearch'))
{
//Initiate a new SQL Query group
$obj->group_start();
//Create a loop to go over each column
foreach($columns as $position => $column)
{
//Add a the SQL statment for searching in that column to the Query Group
$obj->or_like($column, $this->input->post('sSearch'));
}
//Close the SQL Query Group
$obj->group_end();
}
It will perform a search in every column of the table (object).
My problem is when I include related objects...
Is it possible to search in there also using the above function?
It gives me this error when I try it:
Code:
A Database Error Occurred
Error Number: 1054
Unknown column 'avaliator_name' in 'where clause'
SELECT `browsers`.*, `avaliators`.`name` AS avaliator_name FROM (`browsers`) LEFT OUTER JOIN `avaliators` avaliators ON `avaliators`.`id` = `browsers`.`avaliator_id` WHERE ( `browsers`.`engine` LIKE '% Microso%' OR `browsers`.`browser` LIKE '% Microso%' OR `browsers`.`platform` LIKE '% Microso%' OR `browsers`.`version` LIKE '% Microso%' OR `avaliator_name` LIKE '% Microso%' ) ORDER BY `browsers`.`engine` asc
Is there a way of making it happen ?
Also, I am able to sort by the include_related column..... why not searching ?