I'm new to creating websites.I'm creating a Telephone directory search Engine.(Using PostgreSql,CGI scripts).My Database is having Name,Tel.No,City,State,Address.
Upto now I have created a search field like "google" where I can give any of the above Database entries and search.But now I want to give like "name+city+..." So that I can minimize the output entries.
Do you mean you that you want to search all fields? Then:
SELECT *
FROM table_name
WHERE
Name LIKE '%query%'
OR Tel.No LIKE '%query%'
OR City LIKE '%query%'
OR State LIKE '%query%'
OR Address LIKE '%query%'