Hi guys, I'm having an issue and I'm not sure what is going on here. Any help is appreciated.
I wan't to accept user input of the various html entities in their raw form (ie ♥) and store this in the database to output elsewhere. Here's what I'm doing in my code:
Let's say the post value is: Some text goes here that isn't being transferred correctly. I ♥ PHP
Here's what is getting written to the database:
Some text goes here that isn\'t being transferred correctly. I
(sorry I had to break up the ' entity there to get it to show up here -- it is getting into the DB properly, though)
Notice the ♥ is not getting written, along with anything after it... why is this? What am I missing to get this in there?
I wan't to accept user input of the various html entities in their raw form (ie ♥) and store this in the database to output elsewhere. Here's what I'm doing in my code:
Code:
$caption = htmlentities(mysql_real_escape_string($_POST['t']),ENT_QUOTES,'UTF-8'); mysql_query("UPDATE Table SET caption='$caption' WHERE UserID = '$userID'");
Here's what is getting written to the database:
Some text goes here that isn\'t being transferred correctly. I
(sorry I had to break up the ' entity there to get it to show up here -- it is getting into the DB properly, though)
Notice the ♥ is not getting written, along with anything after it... why is this? What am I missing to get this in there?
Comment