homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / WebmasterWorld / New To Web Development
Forum Library, Charter, Moderators: brotherhood of lan & mack

New To Web Development Forum

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)

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.



 1:28 pm on Sep 19, 2007 (gmt 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 Sep 19, 2007 (gmt 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 Sep 20, 2007 (gmt 0)

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.



 4:31 pm on Sep 20, 2007 (gmt 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.

Matt Probert

 5:50 pm on Sep 20, 2007 (gmt 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.



 7:07 pm on Sep 20, 2007 (gmt 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 Sep 22, 2007 (gmt 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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / WebmasterWorld / New To Web Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved