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

Reg Ex
Im trying to search for the string: srv_9 (Dead ???)

I thought to use preg_match, however I d

timezone change with date()
so i put all my times for posts in my made from scratch forum(not phpbb3 or sm)
in my mysql db u

how to put the 0-100 numbers into 1.txt and 100-200 into 2.txt ?
how to put the 0-100 numbers into 1.txt and 100-200 into 2.txt and so on 200-300 into file 3.txt ?

Email with Attachments in PHP
Hi Friends

How to send email in PHP with attachment.
I know simple mail can be sent with

RFQ Configuration - can you make PLANT field an optional field in ME42
Is there a way to make the plant field on an RFQ optional in change mode (ME42)?

need to apply an if/else statement to Tim Thumb script
Not sure how to work this. I essentially want to call a variety of image sizes based on which style

The control with ID 'ace' requires a ScriptManager on the page
I'm trying to add a simple AlwaysVisibleControlExtender to my page, but it's not working. I get the

Handling text changed in text box control using Ajax
I need to create a web form with a text box control. When someone types text into the textbox I nee

Creating Images from images in PHP
Okay well I am trying to make a 'dynamic' calender image with PHP.

I have images like this:

Login Functionality Working Different on IE
This is an odd one, I have a site which has an admin section. The admin pages unsurprisingly require

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