SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jan 2008
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How in MySQL to check to see if two expression are equal irrespective of their case?

    Hello,

    How does one in MySQL check to see if two values are equal or not irrespective of their case?

    I mean I have an expression like:
    X1 = 'Hotels in Boston'

    And a field in MySQL DB named 'keywords'.
    which can contain: 'hotels in boston'

    I want these two to match, irrespective of their case.
    How do I do this via a query command like:

    Code MySQL:
    SELECT COUNT(id) AS kw_ads FROM keywords WHERE keywords = '$X1'

    Regards,

  2. #2
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    use LIKE instead of =
    Check out our new Industry News forum!
    Keep up-to-date with the latest SP news in the Community Crier

    I edit the SitePoint Podcast

  3. #3
    SitePoint Member
    Join Date
    Jan 2008
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aha!
    That simple!
    Cool

    ThanX.

    Quote Originally Posted by longneck View Post
    use LIKE instead of =


Bookmarks

Posting Permissions

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