title: custom query in Magento to insert data to database
body: <p>This is the table structure of the payment_customer table.</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `payment_customer` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `added_date` datetime NOT NULL,
    `merchant_reference_no` varchar(20) NOT NULL,
    `amount` int(10) NOT NULL,
    `order_desc` varchar(100) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
  </code></pre>
  
  <p>Above table stores the data about the customers who made payments. I use below query to insert data to the table in my custom payment gateway module.</p>
  
  <pre><code>$write = Mage::getSingleton('core/resource')-&gt;getConnection('core_write');
  $sql  = " INSERT INTO payment_customer ('id', 'added_date', 'merchant_reference_no', 'amount', 'order_desc') VALUES (NULL, '2013-02-13 00:00:00', '233AX23', '200', 'test'); ";
  $write-&gt;query($sql);
  </code></pre>
  
  <p>Then I tried</p>
  
  <pre><code>$write = Mage::getSingleton('core/resource')-&gt;getConnection('core_write');
  $sql  = " INSERT INTO sampath_payment_customer ('id', 'added_date', 'merchant_reference_no', 'amount', 'order_desc') VALUES (?, ?, ?, ?,?); ";
  $write-&gt;query($sql, array('NULL', '2013-02-13 00:00:00', '233AX23', '200', 'test'));
  $write-&gt;save(); 
  </code></pre>
  
  <p>But both does not insert any data instead it gives me below error message. </p>
  
  <p><img src="https://i.stack.imgur.com/PSBCQ.png" alt="enter image description here"></p>
  
  <p>How can I fix this ?</p>