Query Help
i have forms page allow user select 11 criteria – can select 1 or more 11. not have select 11.
i have following query:
mysql_select_db($database_conndb1, $conndb1);
$query_rsname = sprintf("select distinct table1.search_id, table1.search1, table1.search2, table1.search3, table1.search4, table1.search5, table1.search6, table1.search7, table1.search8, table1.search9, table1.search10, table1.search11, table1.search12, table1.search13, table1.search14, table1.search15, table1.search16, table2.search_id table1, table2 table2.criteria1 = %s or table2.criteria2 = %s or table2.criteria3 = %s or table2.criteria4 = %s or table2.critertia5 = %s or table2.criteria6 = %s or table2.criteria7 = %s or find_in_set(%s, table2.criteria8) or table2.criteria9 = %s or table2.criteria10 = %s or table2.criteria11 = %s , table1.search_id = table2.search_id order table1.search2 desc", getsqlvaluestring($search1_rsname, "text"),getsqlvaluestring($search2_rsname, "text"),getsqlvaluestring($search3_rsname, "text"),getsqlvaluestring($search4_rsname, "text"),getsqlvaluestring($search5_rsname, "text"),getsqlvaluestring($search6_rsname, "text"),getsqlvaluestring($search7_rsname, "text"),getsqlvaluestring($search8_rsname, "text"),getsqlvaluestring($search9_rsname, "text"),getsqlvaluestring($search10_rsname, "text"),getsqlvaluestring($search11_rsname, "text"));
however, when query ran, pulls records – not ones based on search criteria. now, if change or , and select 11, works should. thus, has or operand. however, cannot figure out wrong. operand can use besides or allow work – allow searcher select 1, 2, 3 or more criteria?
i figured out - had move parenthesis around cover entire clause or in it.
More discussions in Dreamweaver support forum
adobe
Comments
Post a Comment