Registered LOCATE



  • I'm trying to build a base search like this.

      $tmpn = mysql_query("SELECT * FROM articles WHERE LOCATE(lower('".$sear."'), lower(name))");
    

    There's a word in the variable $sear, but why he's not looking for registration.

    I'll add that on the local version of the site, when it comes to the phpMyadmin Kirils in the tables, it's fine, but the hosting base also gives the cables, http://hostingkartinok.com/show-image.php?id=34e0c4852c5afbef5344ccfdeb0feadb And on the local host and on the hosts everywhere in the tables is utf-8_general_ci, there's a headline on the pages of the website of all of them, but one difference I can only see - on my local host, I went to Apache at httpd.conf and changed default charset on utf 8 but on the web site, and I don't know what kind of a case.



  • First try to see what's going on with the field down in the request.

    SELECT *, lower(name) AS LowerCase FROM articles
    

    So you'll understand the problem with the code or not, if the register is lower, try to make a request differently, for example,

    SELECT *, lower(name) AS LowerCase FROM articles WHERE
        LOCATE(lower('".$sear."'), LowerCase)
    

    If it didn't work, then look towards the construction of the base code.


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2