Having Some Syntax Problems

Discussion in 'PHP' started by NateJ, May 16, 2009.

  1. #1
    Hey...

    I own a game and on the game forum when a user tries to create a topic within the game forum they get an error.
    Well, After looking at all the errors each user got it was down to the use of a '
    It was a syntax error:


    I have no idea how to fix this error as i'm a beginner when it comes to things like this.

    Here is the whole script of the "insert topic" script:

    Any help will be greatly appreciated.

    Thanks,
    NateJ
     
    NateJ, May 16, 2009 IP
  2. Sky AK47

    Sky AK47 Member

    Messages:
    298
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    45
    #2
    Please use mysql_real_escape_string to filter out unwanted symbols, as the 'I'm' is closing the field.
    So for example:
    $title = mysql_real_escape_string(strip_tags($_POST['title']));
    Code (markup):
    And that for every variable your submitting into the table.
     
    Sky AK47, May 16, 2009 IP
  3. NateJ

    NateJ Active Member

    Messages:
    240
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Thanks, That worked :)

    I appreciate you taking the time to reply.

    -NateJ
     
    NateJ, May 16, 2009 IP