Hope this helps You are trying to dynamically come up with a table name? I don't think this is possible...because doesn't the FROM clause table name need to be resolved prior to the SQL being able to be evaluated and executed?
hope this fix your issue 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, one at a time with , What you have should work but can be reduced to:
select * from table where concat_ws(' ',first_name,last_name)