Search Engine Question

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
TFCameron
Forum Newbie
Posts: 3
Joined: Tue Mar 03, 2009 12:39 am

Search Engine Question

Post by TFCameron »

I'm sure you have all heard this a thousand times. I am new to the whole PHP and mySQL programming. I just wanted to get your opinion on what would be the solution for a search engine for a website I am working on.

The search needs to be able to search for entries in the mySQL database that relational? I think that's the word I need to use. What I mean is that, people will enter text for one part of the search and select a value from a drop down box and these two things need to be grouped together.

I hope I explained in a way that you can somewhat understand. Any help you can offer would be GREATLY appreciated.

Thank you
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Search Engine Question

Post by pickle »

I'm not 100% sure what you need.

Do you want people to type in 1 word for their search, then have a second word be pulled from a <select> box?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
TFCameron
Forum Newbie
Posts: 3
Joined: Tue Mar 03, 2009 12:39 am

Re: Search Engine Question

Post by TFCameron »

Yeah that's exactly what I mean.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Search Engine Question

Post by pickle »

Well, when they submit their form, what they typed in and what was selected in the pulldown box will both be in $_POST. Just concatenate those two variables & throw it in your query.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
TFCameron
Forum Newbie
Posts: 3
Joined: Tue Mar 03, 2009 12:39 am

Re: Search Engine Question

Post by TFCameron »

Okay, but best way to make the search script would be to do it by hand right? I've heard of things can do it for you and wasn't sure if that would be better than doing it myself.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Search Engine Question

Post by pickle »

"better" is a subjective term. For my money I'd do it yourself as it's pretty simple & any third party solution would probably be bloated beyond what you need.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply