problems when insert a charcter ' into database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • perhapscwk
    New Member
    • Sep 2007
    • 123

    problems when insert a charcter ' into database

    MY PHP form...i use it to submit and then insert data into SQL.

    but why if i have a words like he's , then it will output as he\\\\\\\'s ?
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    there seem to be multiple escaping functions (e.g. addslashes()) at work. best is you use the typographical quotation mark ’.

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      Make sure you don't have Magic Quotes enabled. (See get_magic_quote s_gpc)
      It escapes quotes in incoming data before it even reaches your PHP code.

      If it is enabled, you would need to use stripslashes on the data before using it.

      Comment

      Working...