title: MySQL (PDO) exec return nothing, no error, no row added
body: <p>Well, I found similar questions on SO, but it still not working.</p>
  
  <p>I run the following code, then... nothing! No error, nothing inserted.</p>
  
  <p>Here's the php code:</p>
  
  <pre><code>    try
      {
          $obj_sqlsvr = new PDO('mysql:host=localhost;dbname=svmsys', 'root', '');
      }
      catch(Exception $e)
      {
          echo 'Erreur : '.$e-&gt;getMessage();
      }
  
  
  
      $servcatid = $_POST["servcatid"];
  $sysname = $_POST["sysname"];
  $sortorder = 1;
  $friendlyname_fr = $_POST["friendlyname_fr"];
  $friendlyname_en = $_POST["friendlyname_en"];
  
  
  $fee_billtime = $_POST["fee_billtime"];
  $fee_ot = isset($_POST["fee_ot"]) ? $_POST["fee_ot"] : 0;
  $fee_1m = isset($_POST["fee_1m"]) ? $_POST["fee_1m"] : 0;
  $fee_3m = isset($_POST["fee_3m"]) ? $_POST["fee_3m"] : 0;
  $fee_6m = isset($_POST["fee_6m"]) ? $_POST["fee_6m"] : 0;
  $fee_12m = isset($_POST["fee_12m"]) ? $_POST["fee_12m"] : 0;
  $fee_24m = isset($_POST["fee_24m"]) ? $_POST["fee_24m"] : 0;
  $fee_36m = isset($_POST["fee_36m"]) ? $_POST["fee_36m"] : 0;
  $fee_other = isset($_POST["fee_other"]) ? $_POST["fee_other"] : 0;
  
  $adm_timeadded = time();
  $adm_addedby = 1;
  $adm_active = $_POST["adm_active"];
  $adm_start = $_POST["adm_start"];
  $adm_expires = $_POST["adm_expires"];
  $adm_soldlmt = $_POST["adm_soldlmt"];
  
  
  
      try
      {
          $req = $obj_sqlsvr-&gt;prepare("INSERT INTO pricelist(id, servcatid, sortorder, sysname, friendlyname_fr, friendlyname_en, fee_ot, fee_1m, fee_3m, fee_6m, fee_12m, fee_24m, fee_36m, fee_other, fee_billtime, adm_timeadded, adm_addedby, adm_active, adm_start, adm_expires, adm_soldlmt)
                  VALUES(NULL, :servcatid,:sortorder,:sysname,:friendlyname_fr,:friendlyname_en,:fee_ot,:fee_1m,:fee_3m,:fee_6m,:fee_12m,
  :fee_24m,:fee_36m,:fee_other,:fee_billtime,:adm_timeadded,:adm_addedby,:adm_active,:adm_start,:adm_expires,:adm_soldlmt)");
          $req-&gt;bindParam(':servcatid', $servcatid);
          $req-&gt;bindParam(':sortorder', $sortorder);
          $req-&gt;bindParam(':sysname', $sysname);
          $req-&gt;bindParam(':friendlyname_fr', $friendlyname_fr);
          $req-&gt;bindParam(':friendlyname_en', $friendlyname_en);
          $req-&gt;bindParam(':fee_ot', $fee_ot);
          $req-&gt;bindParam(':fee_1m', $fee_1m);
          $req-&gt;bindParam(':fee_3m', $fee_3m);
          $req-&gt;bindParam(':fee_6m', $fee_6m);
          $req-&gt;bindParam(':fee_12m', $fee_12m);
          $req-&gt;bindParam(':fee_24m', $fee_24m);
          $req-&gt;bindParam(':fee_36m', $fee_36m);
          $req-&gt;bindParam(':fee_other', $fee_other);
          $req-&gt;bindParam(':fee_billtime', $fee_billtime);
          $req-&gt;bindParam(':adm_timeadded', $adm_timeadded);
          $req-&gt;bindParam(':adm_addedby', $adm_addedby);
          $req-&gt;bindParam(':adm_active', $adm_active);
          $req-&gt;bindParam(':adm_start', $adm_start);
          $req-&gt;bindParam(':adm_expires', $adm_expires);
          $req-&gt;bindParam(':adm_soldlmt', $adm_soldlmt);
          $res = $req-&gt;execute();
      }
      catch(Exception $e)
      {
          echo 'Erreur : '.$e-&gt;getMessage();
      }
  </code></pre>
  
  <p>Table Structure: <img src="https://i.stack.imgur.com/wlrtD.gif" alt="Table structure"></p>
  
  <p>Table Structure (again) in SQL format:</p>
  
  <pre><code>SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
  SET time_zone = "+00:00";
  CREATE TABLE IF NOT EXISTS `pricelist` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `servcatid` int(11) NOT NULL,
    `order` int(11) DEFAULT NULL,
    `sysname` varchar(100) NOT NULL,
    `friendlyname_fr` varchar(100) NOT NULL,
    `friendlyname_en` varchar(100) NOT NULL,
    `fee_ot` decimal(10,2) DEFAULT NULL,
    `fee_1m` decimal(10,2) DEFAULT NULL,
    `fee_3m` decimal(10,2) DEFAULT NULL,
    `fee_6m` decimal(10,2) DEFAULT NULL,
    `fee_12m` decimal(10,2) DEFAULT NULL,
    `fee_24m` decimal(10,2) DEFAULT NULL,
    `fee_36m` decimal(10,2) DEFAULT NULL,
    `fee_other` decimal(10,4) DEFAULT NULL,
    `fee_billtime` int(2) NOT NULL DEFAULT '0',
    `adm_timeadded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `adm_addedby` int(11) NOT NULL,
    `adm_active` tinyint(1) NOT NULL DEFAULT '1',
    `adm_start` datetime DEFAULT NULL,
    `adm_expires` datetime DEFAULT NULL,
    `adm_soldlmt` int(11) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  </code></pre>
  
  <p>Do you see any error ? And if so, can you please tell me where it is?</p>
  
  <p>Thank you very much,
  Jeremy</p>
  
  <p><strong>EDIT</strong>
  I've renamed the field 'order' to 'sortorder' in both my code and in my table structure (Thanks to Pekka) since it's a reserved word. Still not working.</p>
  
  <p><strong>EDIT</strong>
  Adding Try/Catch arround the prepare and execute command. / Using echo command insteat of die command to diplay errors. (Thanks to david strachan)</p>
  
  <p><strong>EDIT</strong>
  Missing ' in query (Thanks to Drew Pierce)</p>
  
  <p><strong>EDIT</strong>
  PDO query is now parametrized (Thansk to Andy Lester), still no error message and no row in the table.</p>
  
  <p><strong>SAMPLE QUERY (Working on phpMyAdmin)</strong></p>
  
  <pre><code>INSERT INTO pricelist(id, servcatid, sysname, sortorder, friendlyname_fr, friendlyname_en, fee_ot, fee_1m, fee_3m, fee_6m, fee_12m, fee_24m, fee_36m, fee_other, fee_billtime, adm_timeadded, adm_addedby, adm_active, adm_start, adm_expires, adm_soldlmt)
  VALUES(NULL, '2','demo',NULL,'DEMO','DEMO', '12','','','','','','','','1', '1353533266','1','1','','','1')
  </code></pre>