Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2002
    Location
    The Netherlands
    Posts
    725

    Special characters in MySQL

    I have a list of company names in a database that I load in Flash with XML.
    Some names have special characters like: Benny's Garage.
    This: '

    I had to remove those characters otherwise the data was not loaded correctly in Flash. I have tried to escape those characters, but without succes. Anyone know a way?

  2. #2
    Join Date
    Dec 2002
    Location
    United Kingdom
    Posts
    635
    it must be your code or database structure

    if the name is set to varchar(XXX) where xxx is the maximum number of chars up to 255

    It stores correctly I know this because I have just completed a datbase utilizing this for hotel names...

    An realy if your using XML this is the PHP forum and the wrong place to ask questions for it :P
    Saiweb ~ Ramblings of a sysadmin

    My Current Recomended WebHost: Nativespace



    "Acies Latin: a sharp edge or point; mental acuity, sharpness of vision"

    NOTE: Acies is currently beta, the "down" page will be displayed untill I have finished a release candidate

    3DBuzz has a reputation system please rate posts using the icon

  3. #3
    Join Date
    May 2004
    Posts
    21
    I haven't used MySQL too much but I know in SQL you can escape them by doubling up, i.e. ' becomes ''

    Hope that helps.

  4. #4
    Join Date
    Aug 2003
    Location
    Miami, FL
    Posts
    190
    Try with these few functions

    AddSlashes / StripSlashes
    htmlspecialchars
    htmlentities

  5. #5
    Join Date
    May 2004
    Location
    Sowerby Bridge, UK
    Posts
    935
    Also, if you are storing in mysql, then check the manual for mysql_escape_string():

    http://www.php.net/manual/en/functio...ape-string.php

    Ilera

Posting Permissions

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