How to search for several parameters from objects in a database?


Posted on 16th Feb 2014 07:03 pm by admin

I have a database with lots of information about objects.
Now I would like to search for 4 or 5 parameters at the same time (from a form) like this:

I choose from a select-box one parameter and then from another select-box (in the same form) another parameter.
Did you know?Explore Trending and Topic pages for more stories like this.
Now I want all the objects that fit in with all the chosen parameters to be shown.

I have tried this:
Code: $query = "SELECT * FROM vaxtlista WHERE farg='$farg' AND typ='$typ' ORDER BY vetenskapligt";
and this:
Code: $query = "SELECT * FROM vaxtlista WHERE (farg='$farg' AND typ='$typ') ORDER BY vetenskapligt";
I don´t use LIKE and jokers because I know exactly what´s in the fields.

Nothing works.

Someone who has a clue about this? Please help
No comments posted yet

Your Answer:

Login to answer
294 Like 6 Dislike
Previous forums Next forums
Other forums

Save file by click
Hello.
I'm not understand how to save file from page. I'd like make link to file with save abil

mail() says sent but no email received
My code is quite simple:

Code: <?php
$to = "Ty44ler@yahoo.com";
$subje

Login page problems
I developed a website a few months ago and I am now having an issue with logging into it. The place

Include a php
Hello,

I'm trying to include a function that shows the recent searches.
Example I have <

search function
HI guys,

if anyone could point us in the right direction of how to do this, or provide some t

help retrieiving results and doing pagination
Having some trouble trying to get the results to show on more than just one page.

What is ha

login page does not execute a else statement
I've created a login page using sessions.
When an incorrect user name or password is entered then

foreach help.
Hello all,

First time I'm attempting to use a foreach statement and was just wondering if my

Printing issues with xMII 11.5
For some reason, we have one report (and only one) that is giving us fits when trying to print. The

Tree Menu
Hi guys,

Can anyone help me making a tree navigation system? I have a site where I'm allowin

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash