Welcome to WebmasterWorld Guest from 23.22.220.37

Forum Moderators: brotherhood of lan & mack

Message Too Old, No Replies

Basic database search How Do I?

how do i add a basic database search to my site?

     
10:36 am on Sep 19, 2007 (gmt 0)

New User

5+ Year Member

joined:Sept 19, 2007
posts: 2
votes: 0


I would like to know how i go about adding a search to my site for a list of numbers and words? eg i have 234567 service, sample. 876543 , station, flooding, helping
i would like to search for word or number, then for it to return my result with the number and words associated with that number.
Any help would be appreciated.
Cheers
Andrew
1:28 pm on Sept 19, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 12, 2005
posts:5966
votes: 0


Do you want to code one yourself or get an opensource script ;)

For the latter, you can check hotscripts.com, sourceforge.net, freshmeat.net, etc...

5:40 pm on Sept 19, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member jtara is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 26, 2005
posts:3041
votes: 0


That's a big, broad question.

Do you already have the database? Do you need to create it, and periodically update it?

Any CMS should provide the necessary tools to do this.

Otherwise, probably some custom programming - PHP, Perl, whatever with MySQL. It's unlikely you are going to find something already written tailored to your unique requirements.

3:29 pm on Sept 20, 2007 (gmt 0)

Moderator This Forum from GB 

WebmasterWorld Administrator mack is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:June 15, 2001
posts:7557
votes: 3


I agree, this is a very broad question and one that has several answers. If you are using a CMS then the information will already be within a database, if not then you need to gather this information from within your site. Can you please provide some additional information about what you are trying to achieve.

Mack.

4:31 pm on Sept 20, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member jtara is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 26, 2005
posts:3041
votes: 0


Well, this sounds like a textbook-simple database application.

And that's what I would use - a textbook.

Pick up any good tutorial book on, say, PHP and MySQL (there are many books out on that combination), and there will almost certainly be a follow-along simple database application, that they will probably use for several chapters. Likely a simple name-and-address database, etc.

You'll be killing two birds with one stone. You'll be solving your immediate problem. And you'll be learning some skills that you'll find quite useful in the future.

5:50 pm on Sept 20, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Aug 11, 2004
posts:1014
votes: 0


Sounds like you need a simple Perl regular expression search. That way it is easy to return the page or article containing the relevant text.

Matt

7:07 pm on Sept 20, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member jtara is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 26, 2005
posts:3041
votes: 0


Sounds like you need a simple Perl regular expression search. That way it is easy to return the page or article containing the relevant text.

No, not in this case. The original post is a bit confusing, as it says "I would like to add a search to my site...".

He's not interested in adding a "site search", but a simple database that users can look stuff up in, as an additional site feature.

The data isn't currently on the website or in a database. (The author stickied me with some details.)

He has a list of numbers that each correspond to a set of words.

You enter a word, it tells you the number. You enter a number it tells you the words.

Simple database schema, one table.

id integer
word string

Duplicate ids allowed. Duplicate words not allowed. The primary key would be id+word, with id and word and additional keys.

With no details of the posters hosting plan of level of technical knowledge, interest in learning programming, etc. it's hard to give concrete advice, though.

To put it in the most basic terms, though:

- You will need to have a database package (for example, MySQL) installed on your host.

- You will need to have some scripting language (e.g. PHP, Perl, etc.) on your host.

- You will need to create a database schema (layout).

- You will need to create a form for inputting the search criteria.

- You will need to do a bit of programming to take the form data, do a database lookup, and format a results page.

- You might have to do a bit of server configuration

For an experienced web developer, this is certainly less than a day's work - perhaps as little as a couple of hours.

For a newbie with no experience - perhaps weeks - but it will be fun! :)

12:17 am on Sept 22, 2007 (gmt 0)

New User

5+ Year Member

joined:Aug 25, 2007
posts:17
votes: 0


You need to know a programming language (it depends on your site i.e. either php, asp.net, java, perl, etc) and SQL language.