I would like to search my table having a column of first names and a column of last names. I currently accept a search term from a field and compare it against both columns
What you have should work but can be reduced to:
select * from table where concat_ws(' ',first_name,last_name) like '%$search_term%';
Can you provide an example name and search term where this doesn't work?