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.
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

What makes a script your own?
If someone finds a login script online, and changes some variable names around and some other minor

text box alphanumeric caracters only
hi all!

I have search on google on how to enter in a test box only caracters A-Z,a-z,0-9 usi

get url?
how do i get the url of the page i'm currently on, on my website.. i think its get header.. how do i

Slashes
Have a small problem and I'm not able to understand why I'm getting the results I'm getting... and i

cPanel API
Hi Guys,

Need a little guidance. I'm trying to get my script to communicate with cPanel (or W

How can I Compare two xml documents?
Hi all,

I am doing a POC for my project and I am using XE database 10g version.

Checkbox info wont include in Mailto
Hey, im new to php.
Basically I have made a form to request which type of job(s) are needed, whic

error with opendir
when i do this

if ($handle = opendir($dir)) {
while (false !== ($file = readdir($han

multiple recipients + dbuser mail recall
Hello,

I am building a php login script.

When the user registers the script will send

b+ tree
Hi
can every body help me about b+ tree ?(insert & delete)

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