Q:

PDO bindParam changes my string

I've the following code to insert some data into my database:
$query = "INSERT INTO `questions`(`title`,`content`,`set`,`date`) VALUES(:title,:content,:set,:date)";
    $stmt = $db -> prepare($query);
    $stmt -> bindParam(':title',$title,PDO::PARAM_STR);
    $stmt -> bindParam(':content',$content,PDO::PARAM_STR);
    $stmt -> bindParam(':set',$set,PDO::PARAM_INT);
    $stmt -> bindParam('date',$date,PDO::PARAM_STR);
    $stmt -> execute();
    echo '<script>alert("שאלה נוספה בהצלחה");</script>';

The problem is, whenever I view the inserted information in the DB, it turns to weird string such as: &#1489;&#1506;&#1489;&#1512;&#1497;&#1514;
I have no clue why it's happening!
P.S. If I insert English string, it's all right. It shows as a proper english in the DB. It happens when I insert data in my language.

A:

After inspecting it for a while, I found out what was the problem.
The form that I got the input from wasn't inside an HTML tags because it was a quick and very simple interface.
After giving that a thought, I tried to do the form inside  proper HTML tags. I've enclosed the <form> tag in this:
    <html dir="rtl">
    <head>
    <title>Insert a new question</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> // important line
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  </head>
 <body>
<!-- form here -->
</body>
</html

After doing that, the input given was a proper Hebrew letters instead of the HTML entity code.
Hope this will help someone.

