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

Anti Spam Code
Ok where do i start? Probably by telling you I have very little working knowledge of PHP and that I

Standard DES encryption script?
Can anybody point me to a tutorial or a short script that shows how to encrypt some text with salt i

how to query data from website using VC?
I want to query some datum from a website,so I need a program to read data from a .csv file, and ass

adding up might be solved tell us cheers.
i think i finally solved this anybody.

last time i was getting the wrong results.

Code

RSS poster script?
I have found a script that posts RSS's for me on a site that I'm building. However I would like to a

why isn't this PHP code working ???
it's suppose to find a name on the database.

<?php

$s = $_POST["lname&

Displaying a record from mysql in a simple swf file
Hi,

I have a mysql database containing information I would like to display in my swf.

Trigger tag in aspx is not coming
hi all ,iam new to ajax, iam using file upload inside the update pannel but right now i want to use

Perplexing problem showing a .jpg
Please disregard..........I figured it out

PHP - HTTP Digest Authentication - Understanding Code Help
Hi Everyone,

This is my first time on your website and please excuse if I am asking silly que

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