Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004

    Red face Unanswered: Making Search Engine with multiple fields

    I have db with one table. 10 fields for now. Testing...

    Now, I am making web site for inserting, updating and deleting entries in db. All of this is administrative part of web site. Public part of this site should be search-able page with 4 (four) dropdown lists (dinamically populated with values from specific db fields) and 1 (one) text field where user can enter a string. After that, user have to push the Search button and query is executed over table on my db. Web site is taking user to next page with short report that he can print ...
    Everyting would be very easy if a user has to make selection on all of 4 dropdown lists and put some text in text field. But, customer want it just as stronger criteria for search. All fields are not obligatory. He can select a value from first list and put some text and submit Search.... or something like this.... other field are not necessary to be selected with certain values...

    Now, when I take selected values (some or all of them, depends on user) from this page, I need to make some SELECT statement to pick-up answer from my database. Unfortunatelly, I am still looking for this <code> to make this possible (SELECT statement). I tought, it would be easy for me...


  2. #2
    Join Date
    Jan 2004
    anyplace, anywhere, anytime


    I'm sorry to say that but the solution is very simple...
    I suppose you use a web interface with php scripting and apache web server to comunicate with mysql server... In that case all you have to do is to initialize the dropdownlists with some values that cannot be founded through records of fields where the dropdown are related to. Let's say you have field 1 with value over 0 but not 0. You can initialize the dropdown list related to field 1 to 0. After the user submit form you must check if value submited by that dropdown is 0 or not. If is 0 you can skip the select for field 1 because user doesn't made a filter for that field. The same procedure you can use for the rest of dropdowns...

    If you're still blocked, post here and mention your platform and I try to make an example for you...

    All the best...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts