Is there a code to make a search engine search by name?
Moderator: General Moderators
-
cloudplaya
- Forum Newbie
- Posts: 1
- Joined: Wed Jul 04, 2007 9:41 pm
Is there a code to make a search engine search by name?
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)?
- undecided name 01
- Forum Newbie
- Posts: 12
- Joined: Mon Jul 02, 2007 9:25 am
- Contact:
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.Or any specific entity?
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%'