title: Why won't my prepared statement function properly?
body: <p>I have an ajax call affiliated with the php handler that has a prepared statement in it. </p>
  
  <p>And it won't work. No error is caught. </p>
  
  <p>It just stopped working when I changed it from deprecated mysql_real_escape to pdo prepared statememt. </p>
  
  <p>Here is my Code : </p>
  
  <pre><code>$create_pdo=new PDO("mysql:host=$dbhost;dbname=$dbname",$dbuser,$dbpass);
  $statement=$create_pdo-&gt;prepare("INSERT INTO REGISTRY (fname, lname, email, password, age, sex, city, timereg, frcode) VALUES (:fname_received, :lname_received, :email_received,  :password_received, :dob_received, :sex_received, :city_received, :timepassreg, :frcode)");
  $statement-&gt;bindParam(':fname_received', $fname_received);
  $statement-&gt;bindParam(':lname_received', $lname_received);
  $statement-&gt;bindParam(':email_received', $email_received);
  $statement-&gt;bindParam(':password_received', $password_received);
  $statement-&gt;bindParam(':dob_received', $dob_received);
  $statement-&gt;bindParam(':sex_received', $sex_received);
  $statement-&gt;bindParam(':city_received', $city_received);
  $statement-&gt;bindParam(':timepassreg', $timepassreg);
  $statement-&gt;bindParam(':frcode', $frcode);
  $statement_executed=$statement-&gt;execute();
  if ($statement_executed){
  $messagetosend="&lt;font size=\"2\" color=\"#347C17\" face=\"Tahoma\"&gt; &lt;strong&gt;Приветствуем нового пользователя проекта 'Фаворит'!&lt;/strong&gt;&lt;/font&gt;,&lt;br&gt;&lt;font size=\"2\"        color=\"#1F2320\" face=\"Tahoma\"&gt;Для того, чтобы начать пользоваться нашим сайтом, вам нужно будет ввести авторизационный код.&lt;br&gt;Ваш авторизационный код: &lt;font size=\"2\" color=\"#336699\" face=\"Tahoma\"&gt;&lt;strong&gt;".$frcode."&lt;/strong&gt;&lt;/font&gt;&lt;br&gt;Этот процесс проводится в целях борьбы со спамом и его предотвращения.&lt;br&gt;С уважением,&lt;br&gt;Проект 'Фаворит'.&lt;/font&gt;";
  $mailheader='MIME-Version: 1.0' . "\r\n" . 'Content-type: text/html; charset=UTF-8' . "\r\n";
  $mailheader.="X-Mailer: PHP \r\n";
  $mailheader.="From: Фаворит &lt;passwordreminder@favorit.kz&gt;";
  mail($email_received,"Авторизация на проекте 'Фаворит'",$messagetosend,$mailheader);
  $array_to_json=array("database_input" =&gt; "true","mail_sent" =&gt; "true");
  echo json_encode($array_to_json);
  }
  </code></pre>
  
  <p>How can i fix this ?</p>