Not sure if I am posting in the right section, but here it goes.
I am currently trying to learn MYSQL, trying various task using PHP and javascript. So I created a search function on my web-site. My Person table looks like this:
And when the user is searching for a person, he can input first name or last name in the search fiend and that works fine. The problem occurs when the user is typing the full name of the person, like for instance "Steve Jobs".
My SQL query code looks like this:
The problem is, if I input full name, I wont get anything. For example if I type "Steve Jobs" I wont get a single result, even though I know it exists in the database.
So can anybody help me with this SQL query?
I am currently trying to learn MYSQL, trying various task using PHP and javascript. So I created a search function on my web-site. My Person table looks like this:
Code:
ID
fname
lname
And when the user is searching for a person, he can input first name or last name in the search fiend and that works fine. The problem occurs when the user is typing the full name of the person, like for instance "Steve Jobs".
My SQL query code looks like this:
Code:
SELECT * FROM person WHERE fname LIKE "%$QueryString%" OR lname LIKE "%$QueryString%"
The problem is, if I input full name, I wont get anything. For example if I type "Steve Jobs" I wont get a single result, even though I know it exists in the database.
So can anybody help me with this SQL query?