PHP MySQL prepared statement - A search with LIKE containing apostrophe not working -


Using a statement prepared with PHP, I have a problem with a query with MySQL here, the explanation here, step by step -Correct (remove refinement, here to focus on search term).

  1. I have a website with a search box. Without the bracket, the type of user in a hewer gives some good results: (Bracein de Hiver).

  2. The user then searches with the word (de hover) again, nothing is found.

  3. The user searches again with 'hiver' and gives the search correctly brasin de weaver.

It seems that there is a problem when apostrophy is used in the search. I go to my code to check any problem. Here a function is called when a search begins:

   fetch ()) {$ theBears [$ i] ['id'] = $ col1; $ TheBears [$ i] ['name'] = $ col2; $ I ++; } / * Close details * / $ stmt- & gt; Close (); Returns the $ Bears; }        return false; }? & Gt;  

If I am using phpMyAdmin GUI, then I can easily fix this problem by adding double quotes around the search query: "% searchquery%" but the use of ready statement While doing so, I am unable to do this. Is this?

Note : Any type of search without any type of apostrophy is completely bad.

Let me know if you want a link directly in search for people to check it out.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -