473,402 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

designing a search page for database

I am new to PHP and mySQL, and I am trying to build a database of
services (on a service table) provided by agencies (another table),
where one agency can provide many services, but a service belongs to a
single agency. There are about 10 fields in the services table,
including a comments field which needs to be searchable. I don't know
how to design a search page that will be easy to use for so many
fields, and I don't want to actually enter the data until I am sure
that my database design will support the searches that I need to do.
People should be able to search by agency and also by the fields in
the services table, but I need to get results that include the partial
matches to the search fields, for example where some but not all of
the fields match the serach terms. Plus I'd like to have searches
with "and" and "or". I don't know how to design the search page that
I need for this. Any suggestions would be welcome!

A further complication is that the database needs to be usable by
people with limited education/intellectual level and those with
cognitive impairments, so I need an easy-to-understand method of
searching (possibly with a more complicated "advanced search" optons
as well).

Are there books on designing search interfaces/algorithms that you can
recommend? I'm more confused about the design than about the actual
code, which I think I can figure out once I design the page...

Please send me a copy of replies via email to me**@columbia.edu as I
don't always read the group. Thanks!

Millie
Jul 17 '05 #1
5 2089
I noticed that Message-ID:
<3f**************************@posting.google.com > from Millie Niss
contained the following:
Please send me a copy of replies via email to me**@columbia.edu as I
don't always read the group. Thanks!


The nerve of some people!
--
Geoff Berrow
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #2
This class is not the best for doing keyword searches on values. The
person who wrote it is not using SQL to its fullest capability in
limiting the result set to only include relevant matches using a WHERE
clause. Depending on the type of search (wide or narrow) the
following constructs can be used on a varchar datatype:

select name from table where name like '%key1%key2%'

will return all records containing the string in key1 and key2. This
is commonly referred to a narrow search since it really means "find
names where key1 AND key2 are in the name". The next construct is

select name from table where name like '%key1%' or name like '%key2%'

This commonly referred to as a wide search since a name containing
both or only one of the key strings is returned.
renster <renster> wrote in message news:<Xn*********************@203.59.27.131>...
sounds like you need

http://aspn.activestate.com/ASPN/Coo.../Recipe/125901

Jul 17 '05 #4
> This class is not the best for doing keyword searches on values.

do you have an alternative class that you can point me to?
Jul 17 '05 #5
> This class is not the best for doing keyword searches on values. The
person who wrote it is not using SQL to its fullest capability in
limiting the result set to only include relevant matches using a WHERE
clause.


Now that I've looked at the class a little more closely I don't see a where
clause anywhere in the class. I'm not an expert or anything, maybe I have
missed it.

I see that he has put th keywords into an array and does a select statement
for the columns specified returning an array. Then the array of keywords is
shuffled through with the result array to determine matches. Wouldn't this
in effect return a wide search as each element of the array is returned?
Not as efficient as it could be with respect to returning all rows that
match the specified columns (without the search terms). I agree with not
making the best use of SQL.
Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: WindAndWaves | last post by:
Hi Gurus I am keen to make a search page on a website, but I have absolutely zero experience with PHP. I am going to hire an expert, but I thought that it may pay to try it a bit first myself...
3
by: eric rudolph | last post by:
1. I'm designing a PHP-based page that has a lot of design stuff in it. It's very tough to mix the HTML and PHP and have it be readable. The site isn't overall so complicated, there's just a lot of...
83
by: D. Dante Lorenso | last post by:
Trying to use the 'search' in the docs section of PostgreSQL.org is extremely SLOW. Considering this is a website for a database and databases are supposed to be good for indexing content, I'd...
1
by: slonocode | last post by:
I'm wondering if there are certain processes that I could follow to learn to design better classes? Where could I find these processes? Is designing classes more of an art that comes from...
7
by: dad | last post by:
REQ: any utilities for designing front-ends for databases
2
by: Arsalan Ahmad | last post by:
Hi, May be I am a newbie, or may be i dont have that much insight in following systems ..i.e. why i have some confusions as below: In many websites, when search is performed on some keywords...
32
by: keri | last post by:
Hi everyone, Having learnt a little about the basics whilst creating my first db I am now about to start creating a good one! I am about to sit down with a large piece of paper and plan it all...
1
by: hottoku | last post by:
Hi All, I'm having quite a bit of trouble designing a search tool to work with my database. I have found lots of examples from Microsoft Templates to Allen Browne's sample search form. The...
1
Merlin1857
by: Merlin1857 | last post by:
How to search multiple fields using ASP A major issue for me when I first started writing in VB Script was constructing the ability to search a table using multiple field input from a form and...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.