First as a side note, I am using the old deprecated mysql_query
, but at this point I am unable to vastly change my code yet.
OK when I try to do an INSERT with a ® character in it through PHP (coming from a form POST), I'm getting a failure with this code and the insert doesn't happen:
$insert_title = "
INSERT INTO pin (
title,
front
) VALUES (
'".mysql_escape_string($_POST['pintitle'])."',
'".mysql_escape_string($_POST['pinfront'])."'
)";
But when I paste this into MySQL Workbench and execute the statement it does the insert just fine:
INSERT INTO pin ( title, front )
VALUES ( 'test', '®' )
What am I doing wrong on the PHP side?
Here is what mysql_error()
is showing me:
1366: Incorrect string value: '\xAE' for column 'front' at row 1