MySQL query - Trouble with symbols

Discussion in 'MySQL' started by byteventures, Sep 6, 2008.

  1. #1
    I'm trying to replace emails in my database, and I continue to receive an error because I'm using the "@" symbol in my query. Is there a way to avoid this error? Please see my query below.

    $query = "UPDATE tbl_name SET row = WHERE row = tom email";
    mysql_query($query);

    Thanks in advance for your help.
     
    byteventures, Sep 6, 2008 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Use single quotes around the email address
    $query = "UPDATE tbl_name SET column_name= 'tom@tom.com' WHERE column_name = 'tom email'";
     
    mwasif, Sep 6, 2008 IP