Posted By

dmistriotis on 11/26/10


Tagged

db magento


Versions (?)

magento db query directly


 / Published in: PHP
 

  1. /* Snipset for db query */
  2.  
  3. $dbConf = Mage::getConfig()->getNode('global/resources/default_setup/connection');
  4. $db = new Zend_Db_Adapter_Pdo_Mysql(array('host'=> $dbConf->host, 'username' => $dbConf->username, 'password' => $dbConf->password, 'dbname'=> $dbConf->dbname));
  5. $link_data = array(
  6. 'product_id' => $product->getId(),
  7. /* etc... */
  8. );
  9. $db->insert('catalog_product_link',$link_data);
  10. $db->closeConnection();

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: oliverbrildor on December 10, 2010

Great!

Posted By: dmistriotis on December 15, 2010

He he, thanks. I will stop working with Magento :-(

You need to login to post a comment.