[eluser]danmontgomery[/eluser]
First, you can't assign a value to a function. This will never work:
Code:
$term=$this->input->post('term')='Ma';
Other than that, the forum's syntax highlighting in your code should immediately point out what the problem is. You need to escape your single quotes or use double quotes.
Code:
'SELECT subject FROM items WHERE subject LIKE \'Ma%\' UNION ALL SELECT first_name FROM accounts WHERE first_name LIKE \'Ma%\' UNION ALL SELECT description FROM items WHERE description LIKE \'Ma%\''
//or
"SELECT subject FROM items WHERE subject LIKE 'Ma%' UNION ALL SELECT first_name FROM accounts WHERE first_name LIKE 'Ma%' UNION ALL SELECT description FROM items WHERE description LIKE 'Ma%'"