Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004
    Posts
    144

    Unanswered: Binary in where statement

    hi
    i use statement as follows for checking user/pass of users:
    Code:
    SELECT COUNT(*) AS num FROM `tbUsers` WHERE BINARY username = 'un' AND password = 'pw'
    it considers both username and password case-sensetive, how can i change the statement the way that only password considered case-sensetive.
    i think BINARY operand affect the entire where statement, am i right?

  2. #2
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    The binary operator converts a string to an array of bytes and compares the results byte by byte. This only applies to the variable preceding the BINARY reserved word.

    I am not sure why you would want to convert it to a binary and not compare it at a string level?
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •