?
Solved

Multiple filtering with PHP

Posted on 2005-03-19
2
Medium Priority
?
198 Views
Last Modified: 2006-11-17
Hello Experts!

I have an online shopping site. I am selling electronic products like PDAs and Mobiles etc... I would like to write a code so customers at the first place can filter PDA's results according to operating system. Let say there are 30 PDAs that has 400Mhz CPU. After that, there should be other filter option that customer can select memory. Let say customer selected 256MB memory and there are 14 PDAs. At the last step, customer will be able to select PDAs between price £ 150 and £ 250. In the end, customer will have, for instance, 6 PDAs and he will see those 6 PDAs has 400Mhz CPU, 256MB memory and it's between £ 150 and £ 250 so those PDAs will be suitable for that customer. What is the best way of creating structure of that logic with PHP and MySQL. I can give you an example site that does it so you can understand better. http://dealtime.co.uk/xPP-Personal_Organisers . Please filter some brands or prices to see how the logic works.

Kind regards
0
Comment
Question by:hasozduru
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
neester earned 1500 total points
ID: 13584496
Well, at every step where the user selects a filter, add another option to your QUERY.

eg,

They select PDAs:
SELECT * FROM pdas

They select CPU = 400mhz

the query now is:
SELECT * FROM pdas WHERE pdas.cpu = 400

if they now select 128mb ram and expandable storage

SELECT * FROM pdas WHERE pdas.cpu=400 AND pdas.ram=128 AND pdas.ram_expandable=1

etc...

that would be the simplest method :)
0
 

Author Comment

by:hasozduru
ID: 13829700
Hi Neester

Could you please give me an example by writing a simple code?

Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question