If you have two fields in the database does it not make more sense to have two input fields in your GUI? That way you know the
string "Peter" represents a first name, so you can easily do this:
If you've got one input you will need to first try to work out which part of its input corresponds to which field. So its easy if you have "Peter Anderson" ; you just split the string. But what if it just contains "Anderson"? Is that a first name or a last name? Or what if it is "Jon Dahl Tomasson"? If the firstname double-barrelled or the lastname? Or what if you have an Chinese name, where the last name comes first?
If you have defined attributes, it makes like much easier to tailor your GUI to match them. If you are trying to do "free text" searching (sort of google-like behaviour) you probably don't want to use the database directly, rather an IR tool like Lucene.