Wednesday 15 April 2015

Include space in mysql like search -


I am having trouble using mysql as a keyword in some situations. First of all, when I search for 'ABC' , then the result should be searched for ABC and ABCdef but < Code> xyzABCdef no xyzABC . It seems to be the first to use ABC% first but when I search for 'heart of%' , then it is not the line of return in which 'Liver heart' is because it only returns the line to heart > in the beginning of the string. Then I tried to use the % heart% . It is returned 'liver heart' , but not those lines whose heart is at the beginning of the string. I'm stuck here ... that people help me.

Edit With your help, I have come with the following solution, but still I am giving some problem.

  SE.question_id, q.question, q.date, p.fname, p.lname, p.phys_id, p.pic_path questions q Physicians profiles on p.phys_id = Q.phys_id WHERE q Question '% of heart' or question '% heart'% and question 'liver%' or 'quote' like '% liver%' order q.date DESC LIMIT 0,10;   

But this query returns heart failure and symptoms liver as well. There is a solution for this. I need to get the result of heart and liver and as it is said earlier, it must also be satisfied. Is there anyone to solve this

'% heart%' does not work because you do not have anything Like

  like "% of heart" or "% heart%"    

No comments:

Post a Comment