php - Error in FIND_IN_SET -


I'm getting results in phpadmin for this question, but getting the error in php ( your sql syntax an error check manuals related

  Select luxury_properties LP, Property_type PT, your MySQL server version for the right syntax to use the nearby towns of C. ( FIND_IN_SET ( '2', LP.luxury_property_feature_id) or FIND_IN_SET ( '7', Elpikliksri_proprti_fcr_aidi)) and Elpikproprti_ Elpikproprti_taip_aidi by Ris = Pitikproprti_taip_aidi and Elpiksiti = Siksiti_aidi and Elpikstats = 1 order DESC   

where LP.luxury_property_feature_id , separated by commas Value

What is the issue in this query?

has been updated:

I'm implementing this way

  $ Str = ''; if (is_array ($ luxPropFeatures) and amp; amp; amp; amp; $ luxPropFeatures! = 0) {$ selCount = count ($ luxPropFeatures); if; {$ Str = "or FIND_IN_SET (" ($ selCount & gt 1) {foreach ($ val as $ luxPropFeatures) ", LP.luxury_property_feature_id. $ VAL.") "; $ Str [0] = ''; $ Str [1] = ''; }} And {foreach ($ luxPropFeatures as $ val) {$ str = "FIND_IN_SET ('". $ Val. "', LP.luxury_property_feature_id)"; }}} $ Sql ​​= "luxury_properties LP, Property_type PT, select cities where C * (". $ Str. ") And LP.property_type_id = PT.property_type_id and LP.city = C.city_id and LP.status = 1 Order by LP.property_price DESC ";   

where the $ luxPropFeatures checkbox is the selected array

Finally I fixed the problem

  if ($ selCount> 1). {$ Str {foreach ($ luxPropFeatures as val =) or FIND_IN_SET ('"$ val."', Lp.luxi_property_french_id) "; $ Trimmed = ltrim ($ str, "OR"); // $ str [0] = ''; $ Str [2] = ''; }} And {foreach ($ luxPropFeatures $ val) {$ trimmed = "FIND_IN_SET ('". $ Val. "', LP.luxury_property_feature_id)"; }}   

Before I or [ or FIND_IN_SET ( '2', LP.luxury_property_feature_id) or try to avoid FIND_IN_SET of (7 ' ', LP .luxury_property_feature_id) ] $ str [0] =' Character for the first time like '; $ Str [2] = '';

Instead of halting the set, I use the first two characters using ltrim [ $ trimmed = ltrim ($ str, "OR"); ]

Now its work is fine, thanks for the support.

Comments