natasha_sharma Posted March 31, 2016 Share Posted March 31, 2016 I am using mysql statement in some other software using odbc. value = odbcconnectSQL("select MATCH(product_group) AGAINST ( ' +shrimp' IN BOOLEAN MODE) as score from company_info WHERE isin='abcd' AND MATCH(industry, product_group, products, raw_material, business_desc, gisc_ind_2) AGAINST ( ' +shrimp' IN BOOLEAN MODE) "); Problem is I want to use below keyword instead of +shrimp: "+shrimp +(export OR import) " Now the problem is, I am not able to use the Double quotes in this sql statement. How to fix that? Quote Link to comment Share on other sites More sharing options...
Solution Psycho Posted March 31, 2016 Solution Share Posted March 31, 2016 Maybe I am not understanding. Are the double quotes supposed to be part of the text to be compared against or are you intending for them to be delimiters? If the double quotes are meant to be part of the text to be compared against, then you can escape them (using a backslash). value = odbcconnectSQL("select MATCH(product_group) AGAINST ( '\"+shrimp +(export OR import) \"' IN BOOLEAN MODE) as score from company_info WHERE isin='abcd' AND MATCH(industry, product_group, products, raw_material, business_desc, gisc_ind_2) AGAINST ( '\"+shrimp +(export OR import) \"' IN BOOLEAN MODE) "); But, if you are wanting to use the double quotes as a delimiter for the string, I'm not understanding why since the single quotes would work just fine. Quote Link to comment Share on other sites More sharing options...
natasha_sharma Posted April 1, 2016 Author Share Posted April 1, 2016 Thank you Mr. Mod. You answered it. Quote Link to comment Share on other sites More sharing options...
Barand Posted April 1, 2016 Share Posted April 1, 2016 Escaping double quotes was shown to you back in January! Read the replies. http://forums.phpfreaks.com/topic/300694-mysql-full-text-search/?do=findComment&comment=1530578 1 Quote Link to comment Share on other sites More sharing options...
natasha_sharma Posted April 1, 2016 Author Share Posted April 1, 2016 Barand, Impressive attention to detail. actually that qts was not about Quotes. Hence, It was not my focus and i turned a blind eye on that. However, great learning for me to give attention to details. Thankyou Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.