Page 1 of 1

Is there a code to make a search engine search by name?

Posted: Wed Jul 04, 2007 9:44 pm
by cloudplaya
Or any specific entity? like search by last name? All I see with PHP search engines are just strings and it brings up the page, I want to search just by name and it displays all the names such as ( Brad Johnson, Joe Johnson)?

Posted: Wed Jul 04, 2007 10:22 pm
by feyd
..but names are strings. :?

Posted: Thu Jul 05, 2007 9:00 am
by undecided name 01
Or any specific entity?
You can't search for an Entity, but for Entity Instances. We distinguish Entity Instances (Records/Rows in Tables) using their attributes' values, such as last/first names.

However, In case you're looking for the SQL-query to retrieve all names containing "johnson", here's the answer:

Code: Select all

SELCET * FROM People WHERE CONCAT(first_name, ' ', last_name) LIKE '%johnson%'