Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7720875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:46:49+00:00 2026-06-01T03:46:49+00:00

Been searching all over for this but cant find an answer so thought I

  • 0

Been searching all over for this but cant find an answer so thought I would ask here.

I have 5 drop down ‘option box’ lists whose data is populated from a database. The database information is about a user selecting a computer manufacture from the first drop down list, a computer type from the second, a computer colour from the third and finally a minimum and maximum price from the fourth and fifth drop down lists.

These user selected variables are then posted to a php ‘search’ page and a query is run on them. My question is, if (for example) a user only selected a computer ‘manufacture’ and ‘make’ and left all the other option boxes blank, how would I run this on my SQL search? Would I need to set then ‘non set’ variables as wildcards?

Any help would be appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T03:46:51+00:00Added an answer on June 1, 2026 at 3:46 am

    You can build your query dynamically, something like this:

    $sql = "SELECT ... FROM ... WHERE 1=1 ";
    if ($manufacturer != "") {
      $sql .= " AND manufacturer = ...";
    }
    if ($computerType != "") {
      $sql .= " AND computerType = ...";
    }
    // etc...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been searching all over but I can't find any answer to this.
I've been searching all over StackOverflow but i couldn't find an answer for this.
Have been searching all over the internet but struggling to find my answer to
I've been searching for this answer all over internet but so far no luck.
I have been searching all over the internet for an answer to this. It
I have been searching the web and all over stackoverflow, but yet couldn't find
I have been searching all over and i cant seem to find a solution.
I've been searching all over for an answer to this and all of the
I have been searching all over the net to try and find a way
Been searching all around but still cannot find a solution for this problem. My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.