[Help] Inserting parenthesis - Is it possible?

Discussion in 'PHP' started by elegy2009, Feb 10, 2010.

  1. #1
    I have a big doubt:

    $this->Select_Fields .= $value." LIKE '%" . $this->Abluction($this->Search) . "%' OR ";
    I need the line above contains parenthsis like the result below...

    Result: (Title LIKE '%search%' OR Category LIKE '%search%' OR Description LIKE '%search%' OR Tags LIKE '%search%)

    How and where do I insert these parenthesis in the code line?

    Look forward to your reply! thanks
     
    elegy2009, Feb 10, 2010 IP
  2. Brandon.Add.On

    Brandon.Add.On Peon

    Messages:
    178
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Any non variable/function should go inside the quotes. If you use double quotes then variables and chars with special meanings such as \r\n can go inside it. if you use single quotes than only string chars can go inside it and all chars will be represented by its literal meaning.
     
    Brandon.Add.On, Feb 10, 2010 IP
  3. elegy2009

    elegy2009 Member

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    Could you please correct my code with parenthesis? i'm new in PHP programming , I'm sorry!
    Thanks a lot!!!!!!!!!!
     
    Last edited: Feb 11, 2010
    elegy2009, Feb 11, 2010 IP
  4. DEWebDev

    DEWebDev Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Try this and see if it will work. Just add it right underneath the code you provided, don't replace the code.

    $this->Select_Fields = "(" . $this->Select_Fields . " ) ";
    PHP:
     
    DEWebDev, Feb 11, 2010 IP