php/mysql problem(question)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alex79
    Confirmed User
    • Jun 2002
    • 996

    #1

    php/mysql problem(question)

    i have ' character in my database, but when i make a select and display the content with echo() the ' character is auto replace with ? character..
    what i have do to stop this auto replace?
  • Clarion
    Confirmed User
    • Jan 2005
    • 148

    #2
    That's kinda bizarre...does your page have a character set selected?

    [HTML]<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />[/HTML]

    If that's not it, try inserting it into the database with the function addslashes:
    Code:
    addslashes("This is the string I'm trying to input");
    Lastly, if that doesn't work, make sure you're using the standard ascii ' symbol and not some strange variation like word puts in...
    Structure Northwest :: the cure for the common code ::
    AIM: Asatruel | Yahoo!: Asatruel | ICQ: 111-638-053

    Comment

    • alex79
      Confirmed User
      • Jun 2002
      • 996

      #3
      i don't have that HTML code on my pages.. and when i've entered the text to the database i used addslashes() function.. now when i select the text from database, i use stripslashes() and echo($text) and instead ' character i get ?

      anybody else know what can be?

      Comment

      • borked
        Totally Borked
        • Feb 2005
        • 6284

        #4
        What browser are you using and what character(s) is displaying as ?
        ?
        Have you tried converting symbols to their html counterpart before entering them in the database using htmlentities() ?

        For eg, the Euro symbol, depending on the encoding text will displaying incorrectly on Firefox, but will do fine when 'encoded' using htmlentities() for storing.

        For coding work - hit me up on andy // borkedcoder // com
        (consider figuring out the email as test #1)



        All models are wrong, but some are useful. George E.P. Box. p202

        Comment

        • Fuckin Bill
          Confirmed User
          • Feb 2003
          • 1020

          #5
          Sounds like a character set problem either in the page/server or your browser.

          Comment

          Working...