Inserting Registered Trademark Symbol/Copyright Symbol into MySQL with PHP

12,241

You can look into converting the copyright/trademark symbol from and into an HTMLEntity in order to ease data transfer to the database.

Reference: http://www.php.net/manual/en/function.htmlentities.php

Reference: http://www.php.net/manual/en/function.htmlspecialchars.php

© Copyright Symbol: ©

™ Trademark Symbol: ™

Share:
12,241

Related videos on Youtube

AnchovyLegend
Author by

AnchovyLegend

Updated on July 07, 2022

Comments

  • AnchovyLegend
    AnchovyLegend almost 2 years

    I am having a hard time understanding how to insert the registered trademark sybol and copyright symbol to my mySQL database using php.

    When I insert the normal character of the reistered trademark symbol, it returns some random values when I try to retrieve it.

    • j0k
      j0k almost 12 years
      Which kind of random values?
    • DaveP
      DaveP almost 12 years
      What character set is your db table using?
  • Lèse majesté
    Lèse majesté almost 12 years
    Where would the BOM come from? MySQL doesn't use BOM, so it wouldn't be inserted by MySQL. And if it comes from his code editor, it would be the first character in his source code, which wouldn't be able to find its way into the database.
  • Robert H
    Robert H almost 12 years
    I had similar issues trying to insert the registered trademark symbol, I was getting an incorrect string value from MySQL with the BOM listed. The data being passed to MySQL is the origination of the issue, but the issue is being reported in MySQL.
  • dianovich
    dianovich almost 12 years
    What about when we don't want to output results as HTML?