SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot XandroZ's Avatar
    Join Date
    May 2006
    Posts
    147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysql escape characters

    I need to insert a text into a Mysql table.The text contains ',";
    So I tried mysql_escape_string or mysql_real_escape_string functions.

    The problems is with this type of string,for example:
    Code:
    Nancy's dog
    and after I applied the function
    Code:
    Nancy\'s dog
    (escaped), but mysql doesn't recognize the escaped character.

    I have :
    # MySQL 5.1.33
    # PHP 5.2.9

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2002
    Location
    Bristol, UK
    Posts
    2,240
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you post the exact query and the error?

  3. #3
    SitePoint Guru risoknop's Avatar
    Join Date
    Feb 2008
    Location
    end($world)
    Posts
    834
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Seems like you are applying addslashes() to the string before you insert it in the database but that's just my guess.

    We need to see the code or else we probably can't help you.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •