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

Hit counter updating once per IP - IP HIT COUNTER
I have a hit counter, for the amount of views on a tutorial.
It'll do the query and then do..

Preg_match with an array
is there an away to use preg_match with an array?

i want to check a string with an array to s

send() and recv() parameters confusion
On server Side:
int recv (Socket,Buffer, Length, Flags)
On Client Side:
int send (Soc

user administration
Dear @all,

what I have to do to set the user defaults for new users. At the moment I woul

Calander Basic Spript help
hi, just starting out with PHP and have the following script:

<?php
//This gets t

What's best way to get a user's Word doc converted to simple html and images?
Hi all,

I was just wondering if anybody has any experience of this.
Basically, I'm buildin

Displaying an image using echo command
I had done a query on my database, one of the fields being an image reference to a directory where a

PHP Game
hy i was wondering what's the best method in order to make some automatic updates in a php game
<

Baffled by Undefined Index in Simple Array: Please Help!
Hello. I have a form which posts an array to this script. However, I can't seem to access the values

Help with search.php
Hello All

I need the search engine on a site I am building at the moment to display the searc

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