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

Giving the below syntax error
Dear Experts,

I have used 2 buttons in gui status as display and cjhange.When the user wi

Multiple Dropdown Selections
I have a form that let's a user insert a page with the ability to select categories. I want them to

Recognising Revenue daily
Hello.
Has anyone come across daily recognition of deferred income?
We want to implement R

help countdown timers
hello every one,

I'd like to know how to insert many countdowns in the same page.
The dura

PHP Login
Hey!
I got this shopcart code online, am trying to modify it but am getting an error when i try a

Adding to an Int row in db
Hi, i have a database which houses all of the users of my site. One of the columns is for points whi

Do While statement
hi guys,

This may sound trivial but im new to php and as part of an assignmenti have to const

elseif help!
OK so I'm new to the site, as well as PHP altogether (Trying my hand at managing an online RPG) and

ImageCreate()
When I create an image and add text to it I want my text to be replaced with a PNG image, because th

Prevent PHP mail( ) from appending hostname to from address
Hey guys,

I want to be able to send texts to phones via email (since each phone has their own

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