MySQL - WHERE name contains the text....

Discussion in 'PHP' started by gabrola, Dec 18, 2008.

  1. #1
    Well I'm trying to run a mysql query and a where the field contains the text.
    like:
    
    mysql_query("SELECT * FROM users WHERE username contains ';;' ");
    
    PHP:
    This is not real but I want to know what is equivalent to this.
     
    gabrola, Dec 18, 2008 IP
  2. fireflyproject

    fireflyproject Active Member

    Messages:
    969
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    70
    #2
    select * from users where username like '%content%'

    The percent signs indicate "is somewhere sloshed in there". That's a technical term by the way.
     
    fireflyproject, Dec 18, 2008 IP
  3. gabrola

    gabrola Active Member

    Messages:
    125
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #3
    Thanks a bunch
     
    gabrola, Dec 18, 2008 IP
  4. fireflyproject

    fireflyproject Active Member

    Messages:
    969
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    70
    #4
    No problem good sir.
     
    fireflyproject, Dec 18, 2008 IP