title: Inserting new rows in db using php and DBMS is postgresql?
body: <p>I searched for this 'basic' (I'm new at postgresql but a bit familiar w/ MySQL) question in the internet but there are only a few references when it comes to postgresql and php so I turned to stackoverflow. :D</p>
  
  <p>I followed the example at the yii website <a href="http://www.yiiframework.com/doc/guide/1.1/en/database.dao" rel="nofollow">http://www.yiiframework.com/doc/guide/1.1/en/database.dao</a> but I keep on getting errors. Here is my code:</p>
  
  <pre><code>    $barya = 'INSERT INTO "BILL" (Assessed_Value,Total_Assessed_Value,Penalty_Percentage,Basic_Tax,SEF_Tax,Discount) VALUES (:Assessed_Value,:Total_Assessed_Value,:Penalty_Percentage,:Basic_Tax,:SEF_Tax,:Discount)';
  $command = $connection-&gt;createCommand($barya);
          $command = $connection-&gt;createCommand($barya);
          $command = bindParam(":Assessed_Value", $compute, PDO::PARAM_STR);
          $command =bindParam(":Total_Assessed_Value", $compute, PDO::PARAM_STR);
          $command =bindValue(":Penalty_Percentage", 0.20, PDO::PARAM_STR);
          $command =bindValue(":Basic_Tax", 0.15, PDO::PARAM_STR);
          $command =bindValue(":SEF_Tax", 0.20, PDO::PARAM_STR);
          $command =bindValue(":Discount", 0.03, PDO::PARAM_STR);
          $command-&gt;execute();
  </code></pre>
  
  <p>My error is a server error: 500. Is this the right way of inserting new rows in postgre?</p>
  
  <p>[EDIT EDIT]</p>
  
  <p>I've found out that my syntax was wrong (after randomly replacing " with ' and some arrows).</p>
  
  <p>It goes like:</p>
  
  <pre><code>$barya = 'INSERT INTO "BILL" ("Assessed_Value","Total_Assessed_Value","Penalty_Percentage","Basic_Tax","SEF_Tax","Discount") VALUES(:Assessed_Value,:Total_Assessed_Value,:Penalty_Percentage,:Basic_Tax,:SEF_Tax,:Discount)';
      $command = $connection-&gt;createCommand($barya);
      $command-&gt;bindParam(":Assessed_Value", $compute, PDO::PARAM_STR);
      $command-&gt;bindParam(":Total_Assessed_Value", $compute, PDO::PARAM_STR);
      $command-&gt;bindParam(":Penalty_Percentage", $compute, PDO::PARAM_STR);
      $command-&gt;bindParam(":Basic_Tax", $compute, PDO::PARAM_STR);
      $command-&gt;bindParam(":SEF_Tax", $compute, PDO::PARAM_STR);
      $command-&gt;bindParam(":Discount", $compute, PDO::PARAM_STR);
  $command-&gt;execute();
  </code></pre>
  
  <p>but now I'm having problems with foreign keys. T.T Anyone knows how to? Thanks. :D</p>