SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: Searching!!!
-
Feb 9, 2001, 13:38 #1
- Join Date
- Oct 2000
- Location
- Location:
- Posts
- 94
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I'm trying to devise a form which will allow users to search for all the data within a database which I have just created.
The name of the database is 'Music_groups'.
This database is full of different categories of music groups which are all contained within a single table called 'groups'.
This table holds the names of music groups in the following categories;
Rap
Jazz
Chior
Barbershop
This table is formed of the following coloumns;
Category
Group_name
Contact_name
Address
City
Telephone
E_mail
Information
In basic terms, this form has to allow users to;
1) Search for any group within the table
2) List all the groups in the table according to the columns 'Category' and 'City'.
(I chose 'Category' and 'City' because they are the most important fields which users can easily identify with).
I'm a beginner when it comes to php and I'm really not sure how to make this happen. Can anyone please show me a script which can perform such searches on the database according to whatever columns the user specifies???
I hope I have made sense!
Thanx very much,
Koncise.
-
Feb 9, 2001, 14:05 #2
- Join Date
- Aug 1999
- Location
- Pittsburgh, PA, USA
- Posts
- 3,910
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Well, short of writing an actual functional script, I can explain a tiny bit of the logic behind it.
It's a simple SELECT command...you have a search box...something like this:
Code:<input type="text" name="query" size="40">
Code:SELECT * FROM Music_Groups where description OR band_name LIKE "%$query%"
Bookmarks