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: ™
;
Related videos on Youtube
Author by
AnchovyLegend
Updated on July 07, 2022Comments
-
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 almost 12 yearsWhich kind of random values?
-
DaveP almost 12 yearsWhat character set is your db table using?
-
-
Lèse majesté almost 12 yearsWhere 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 almost 12 yearsI 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 almost 12 yearsWhat about when we don't want to output results as HTML?