Multiple query search php and mySQL

internal search engine using drop down menus and text fields

Page 1 of 1

4 Replies - 7981 Views - Last Post: 04 March 2010 - 05:27 PM Rate Topic: -----

#1 sfw  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 27
  • Joined: 24-April 08

Multiple query search php and mySQL

Posted 04 March 2010 - 01:35 PM

Hi.
I want to create an internal site search that has 2 drop down menus; one for zone (all, east, west, central) and one for medical specialty (all, allergy, sports injury, trama). Also, a text field that users can input their service provider. The idea is that users select their zone and medical specialty via the drop downs, then enter their service provider via the text field and submit the query. the query should filter the user inputs and output matching results. First, I would like advice on how to set up my database. should I make a table for each of 'zone', 'medical specialty' and 'provider'? Or, should I only use one table. I've found tutorials for article searches and word searches but nothing that uses both drop downs and text areas. thank you in advance.

Is This A Good Question/Topic? 0
  • +

Replies To: Multiple query search php and mySQL

#2 sfw  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 27
  • Joined: 24-April 08

Re: Multiple query search php and mySQL

Posted 04 March 2010 - 01:53 PM

Hi,
I want to create an internal search for users to search for a medical service provider in their area. I want to have 2 drop downs; zone (all, south, central, west) and the other is specialty (all, allergy, muscular, trama). Also, i want a text field where users can enter the name of a service provider. The idea is that the 2 drop downs and the text field search the database for matches of the criteria. My first question is how should i set up my database? should i create a table for each of 'zone', 'specialty' and 'service provider'? is there a tutorial that can help me?
thank you.
Was This Post Helpful? 0
  • +
  • -

#3 designthedesign  Icon User is offline

  • New D.I.C Head

Reputation: 13
  • View blog
  • Posts: 47
  • Joined: 30-September 09

Re: Multiple query search php and mySQL

Posted 04 March 2010 - 02:35 PM

You wouldn't need to create a table for each of those categories, those would be columns in one table.

hhttp://www.w3schools...mysql_intro.asp
Was This Post Helpful? 0
  • +
  • -

#4 bstonehill  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 113
  • Joined: 21-January 08

Re: Multiple query search php and mySQL

Posted 04 March 2010 - 02:43 PM

I would create a table of providers, and have provider_name, zone, specialty, etc as fields in that table. This way you can narrow your search like this:

SELECT FROM providers WHERE zone = 'zone1' AND specialty = 'specialty1' AND provider_name LIKE 'text_field_entry%' SORT BY provider_name;



These are the best two sites I have found for learning PHP and MySQL:
www.tizag.com
www.w3schools.com
Was This Post Helpful? 0
  • +
  • -

#5 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1639
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Multiple query search php and mySQL

Posted 04 March 2010 - 05:27 PM

The tutorials section is not the place to ask your programming questions. Moved to PHP
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1