Write a PHP/MySQL query for a search field on a web page
$10-30 AUD
Completed
Posted almost 10 years ago
$10-30 AUD
Paid on delivery
I'm working on a PHP/MySQL web database project and I need a bit of help with fetching records from the database.
The database stores people's names, with the following fields:
known_as (what the person may be known as )
given_names (person's given names)
surname (a display surname)
surname_1 (first single surname)
surname_2 (second single surname)
surname_3 (third single surname)
surname_4 (fourth single surname)
surname_alias (alias surname)
entry (text)
url
I need to write a MySQL query to do the following after a user has done a web search on this database, then print the results out on a web page using PHP:
Select any records where (surname, surname_1, surname_2, surname_3, surname_4 or surname_alias) is LIKE 'search_query'.
If records exist, it should display the surname that matched the search_query (from any of the surname fields above), then the person's given name and known as name, and it should be ordered by the matched surname field, then the given name field (as a hyperlink pointing to the 'url' field).
Let me know if you have any questions about this task, thanks.
I'm not looking to build a whole system, I just want the correct MySQL query and PHP code to display that results from the above scenario, thanks.
Hi ,
We have 40+ skilled web designer & development team, so please give few minutes for technical discussion of your requirement.
Waiting for your reply & chance for further discussion.