beginann Posted January 10, 2010 Share Posted January 10, 2010 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: $query = "SELECT * FROM vaxtlista WHERE farg='$farg' AND typ='$typ' ORDER BY vetenskapligt"; and this: $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! Link to comment https://forums.phpfreaks.com/topic/187908-how-to-search-for-several-parameters-from-objects-in-a-database/ Share on other sites More sharing options...
redarrow Posted January 10, 2010 Share Posted January 10, 2010 I can not help then you don't use LIKE have you tried echoing this out yet ? $query = "SELECT * FROM vaxtlista WHERE farg='$farg' AND typ='$typ' ORDER BY vetenskapligt"; do all variables match correctly...... Link to comment https://forums.phpfreaks.com/topic/187908-how-to-search-for-several-parameters-from-objects-in-a-database/#findComment-992155 Share on other sites More sharing options...
beginann Posted January 10, 2010 Author Share Posted January 10, 2010 Yes, I have tried to echo that, but I only get a message that says that there are no objects matching these criterias (but I know there is!). And I have tried to use LIKE also, the same result. All variables are correct. Link to comment https://forums.phpfreaks.com/topic/187908-how-to-search-for-several-parameters-from-objects-in-a-database/#findComment-992159 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.