Closed Thread
Results 1 to 5 of 5

Thread: MySQL AND

  1. #1
    phillw's Avatar
    phillw is offline Learning Programmer
    Join Date
    Aug 2009
    Location
    Northwest England (UK)
    Posts
    82
    Blog Entries
    1
    Rep Power
    0

    Unhappy MySQL AND

    I'm no doubt missing something blindingly obvious, but I am puzzled at this behaviour ....

    Code:
    SELECT * FROM MGJ_Parts WHERE Description LIKE '%oil%'
    Returns all the results with oil in the description ....
    e.g.
    Code:
    MGJ Chain Oil (Non Fling)
    MGJ Rock Frost (Anti Freeze Air Tool Oil)
    MGJ Hydraulic Oil HLP32
    ..
    ..
    And

    Code:
    SELECT * FROM MGJ_Parts WHERE Description LIKE '%air%'
    Returns ...
    Code:
    MGJ Rock Frost (Anti Freeze Air Tool Oil)
    But ....

    Code:
    SELECT * FROM MGJ_Parts WHERE Description LIKE ' %air% ' AND Description LIKE '%oil%'
    Returns nothing

    Phill.
    Last edited by phillw; 10-01-2009 at 03:09 AM. Reason: Typo

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    phillw's Avatar
    phillw is offline Learning Programmer
    Join Date
    Aug 2009
    Location
    Northwest England (UK)
    Posts
    82
    Blog Entries
    1
    Rep Power
    0

    SOLVED

    Ooops ....

    My Code was placing spaces around %air% .... Found it - Only an hour of bashing my head against the wall

    Phill.

  4. #3
    LiLMsNinja's Avatar
    LiLMsNinja is offline Learning Programmer
    Join Date
    May 2008
    Posts
    42
    Rep Power
    0

    Re: MySQL AND

    LOL! I just had to say it.. glad to know i'm not the only crazy one that hates, comma's, parenthesis, quotes, spaces, and semi colons.
    CodeMonkey +15 | CommunicationSkills -34 | ClarityUsingEnglish -55 | Clarity while pointing at the monitor and making vigorous facial expressions, occasional grunts, and mouth clicks +150

  5. #4
    phillw's Avatar
    phillw is offline Learning Programmer
    Join Date
    Aug 2009
    Location
    Northwest England (UK)
    Posts
    82
    Blog Entries
    1
    Rep Power
    0

    Re: MySQL AND

    Quote Originally Posted by LiLMsNinja View Post
    LOL! I just had to say it.. glad to know i'm not the only crazy one that hates, comma's, parenthesis, quotes, spaces, and semi colons.
    I think I'll have an MySQL statement to the effect of ....

    Code:
    mysql> SELECT * from 'life'
    On my grave stone ...... Because, if the 'good Lord' doesn't 'get your soul' - those missing semi-colons surely will

    Phill.

  6. #5
    phillw's Avatar
    phillw is offline Learning Programmer
    Join Date
    Aug 2009
    Location
    Northwest England (UK)
    Posts
    82
    Blog Entries
    1
    Rep Power
    0

    Re: MySQL AND

    bbs - found another bug in the search routine ... ::SIGH::
    Last edited by phillw; 10-08-2009 at 04:04 PM. Reason: Found a bug in my code

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Use PDO for mysql or standar mysql functions?
    By lol33d in forum PHP Development
    Replies: 7
    Last Post: 05-07-2011, 08:41 PM
  2. Replies: 1
    Last Post: 10-20-2010, 12:38 AM
  3. [C#]MySQL] Host '****' is not allowed to connect to this MySQL server
    By ZaroX in forum Database & Database Programming
    Replies: 2
    Last Post: 02-16-2010, 08:34 PM
  4. Replies: 0
    Last Post: 01-26-2009, 11:14 AM
  5. MYSQL CheatSheet - A must for MySQL Users
    By reachpradeep in forum Database & Database Programming
    Replies: 1
    Last Post: 03-03-2007, 01:05 PM

Tags for this Thread

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