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

Data type mismatch
Hi,
I am migrating data from algol to c.I mapped real datatype in algol to double datatype in

with clause
hi all, i have a big query that usually access the same table more than once. for example, i have s

how to get IP address?
hey guys,

i have this code which is supposed to get me the IP address of my site visitors:

PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

Echoing If Function?
A script I am using has If statements in the comments form to basically tell the form what to do. Cu

Convert Binary String to Decimal
Trying to Get:
Decimal: 305419896

Out of:
Binary String: xV4

PHP and Javascript
Hi Guys,

Im trying to load the contents of an html file into a text area for editing, this is

AJAX form submit
I recently built a form that submits data to my database with an ajax function that is called throug

how to insert value
I am having file bookissueadd.php..... in which i am having tag

<td height="21&q

Having a problem get the selected item from a drop down menu
I have been looking at this for days now.

I have a drop down menu that get it's values from a

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