PDA

View Full Version : Search Engine Format For MySQL Database - > Request For Help


Steve
03-19-2007, 09:18 AM
Hello All,

Given my lack of experience, ...I would like to request help on a variation of the 'simple search engine'....specifically...

Does anyone have (and would be willing to share) both the form code and the php code (similar to what Niko provided earlier here (http://www.websitedatabases.com/database-forum/showthread.php?t=11)) of a search engine that can search a database table with the following input capabilities:

1 - Searching the database table using four (4) different search string data fields in the table (like filtering)

2 - Three of the four (table field) search string entry boxes to have drop down for 'menu style' selection of entry by the user. And one search string (table field) entry box to be just a normal entry box.

I think I may be able to figure out how to set up (adjust) something like this to work with my database table, if the code is available, ...but I know that I am not currently at a sufficient level of expertise to write this on my own.

An example of what I want to do can be found on the homepage of the SitterCity website, http://www.sittercity.com/index.php (http://www.sittercity.com/index.php) . Look in the 'Try It Out' shaded section where the user enters several different search string data. The drop down menus are of interest for my website application.

Any direction or code examples will be appreciated. Thanks :)

twenty1
03-19-2007, 07:14 PM
I guess you would need to modify the sql query a bit in that sample.

You would just inlcude each variable for the field in the sql query and use AND.

"select * from yourtable WHERE fld1 ='$search' AND fld2 = '$search2'";

Happy coding :D

Steve
03-19-2007, 07:47 PM
I think I get it ...you mean that I use the AND code in order to effectively add the additional 'search' string fields (or boxes) for a multiple variable search engine.

Do I have that right?