Be aware that if you have large numbers of entries in the table you should use indexes on first name and last name.
Code:
SELECT firstname,
lastname
FROM table
WHERE firstname = '$input'
OR lastname = '$input'
OR Concat(firstname, ' ', lastname) = '$input'
If performance becomes a big issue try the separating the firstname and lastname programmatically and then issue the statement as follows:
Code:
SELECT firstname,
lastname
FROM table
WHERE firstname = '$input'
OR lastname = '$input'
OR ( firstname = '$inputfirstname'
AND lastname = '$inputlastname' )