I am using MySQL and PHP 5.3 and tried this code.
$dbhost = \'localhost\';
$dbuser = \'root\';
$dbpass = \'\';
$con = mysql_connect(\"localhost\", \"root\",
The possible way to insert Special characters using PDO, just follow the these to steps:
1) Set the Attribute to you connection class.
$this->db->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, "SET NAME'utf8'");
2) Now you can use htmlspecialchars while query creation and insertion to database:
$ShortDescription = htmlspecialchars($_POST['ShortDescription'], ENT_QUOTES);
$LongDescription = htmlspecialchars($_POST['LongDescription'],ENT_QUOTES);
And it will work fine.