title: What is PDO, how is it related with SQL injection, and why I should use this?
body: <p>Actually I did google and got so many results, but I can't understand, because I'm new in this field.</p>
  
  <p>So what is an easy way that what is PDO, why I should use this, what is SQL injection, etc. with an example?1</p>
  
  <p>Actually now my code is like that.</p>
  
  <h3>config.php</h3>
  
  <pre><code>&lt;?php
      $mysql_hostname = "localhost";
      $mysql_user = "root";
      $mysql_password = "";
      $mysql_database = "testdb";
      $prefix = "";
      $bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Could not connect database");
      mysql_select_db($mysql_database, $bd) or die("Could not select database");
  ?&gt;
  </code></pre>
  
  <h3>insert.php</h3>
  
  <pre><code>&lt;?php
      include('config.php');
      $account_no = $_POST['account_no'];
      $amount = $_POST['amount'];
      $save = mysql_query("INSERT INTO tableamount (account_no, amount) VALUES ('$account_no', '$amount',)");
      header("location: index.html");
      exit();
  ?&gt;
  </code></pre>
  
  <h3>index.html</h3>
  
  <pre><code>&lt;html&gt;
      &lt;body&gt;
          &lt;form action="amount.php" method="post" enctype="multipart/form-data" name="addroom"&gt;
              Account Number&lt;br /&gt;
              &lt;input name="account_no" type="text"/&gt;&lt;br /&gt;
  
              Amount&lt;br /&gt;
              &lt;input name="amount" type="text"/&gt;&lt;br /&gt;
  
              &lt;input type="submit" name="Submit" value="Submit" id="button1" /&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>