title: Can't insert decimal value with PDO
body: <p>I've been trawling the web for hours now and trying different methods, and I can't work out why PDO can't insert any row where one of the values contains a decimal.</p>
  
  <p>For example, if the value entered into the cost field has no decimal value then it works fine. But anything like with a decimal and it just ignores the whole row.</p>
  
  <p>200 works, even 200.00 works. But things like 39.99 don't.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>$invoice_id = $db-&gt;lastInsertId('id');
  
  $item_name = $_POST['item_name'];
  $item_qty = $_POST['item_qty'];
  $item_cost = $_POST['item_cost'];
  $item_vat = $_POST['item_vat'];
  
  for($i = 0; $i &lt; count($item_name); $i++) {
  $item_query = $db-&gt;prepare("INSERT INTO hm_invoice_items(invoice, item, qty, amount, vat) VALUES(:invoice, :item, :qty, :amount, :vat)");
  $item_query-&gt;bindParam(":invoice", $invoice_id);
  $item_query-&gt;bindParam(":item", $item_name[$i]);
  $item_query-&gt;bindParam(":qty", $item_qty[$i]);
  $item_query-&gt;bindParam(":amount", $item_cost[$i]);
  $item_query-&gt;bindParam(":vat", $item_vat[$i]);
  
  if (!$item_query-&gt;execute())
      {
          die(showMessage("There has been a problem adding the invoice items.", "Error!"));
      }
  }
  </code></pre>
  
  <p>A var_dump tells me that the insert query is receiving the values, but it does not like dealing with decimals.</p>