Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2004
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    extra backlashes on table output

    I have an issue that when I extract data from mysql table it's including backlashes with quotes. Example if I enter
    "james" in the table when I extract the data I get "\james"\

    Is there a function to correct this issue? This is a remote server and I don't have access to the PHP.ini file

    I am using the code below to enter a value into the table

    Code:
    trim(mysql_real_escape_string($value))

    I am using the follow code to retrieve the data

    Code:
    <?php echo $row['value_name']; ?>


    Both codes are incomplete but these are the lines that I think are affecting the output. Any thoughts or ideas are welcome

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    There is indeed a function to help you out, it's called stripslashes().

  • #3
    New Coder
    Join Date
    Aug 2006
    Posts
    34
    Thanks
    0
    Thanked 1 Time in 1 Post
    Those quotes shouldn't be in the database when using mysql_real_escape_string().

    It's likely that $value is a GET/POST/COOKIE value (right?) and that PHP is magically adding quotes around that data. Then when you call real_escape, it'll backslash the backslashes so they'll end up in your database. You might want to look into the function get_magic_quotes_gpc and see how you can deal with it, if that is indeed the culprit.


  •  

    Posting Permissions

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