zoukankan      html  css  js  c++  java
  • magento直接操作数据库

     
         $write = Mage::getSingleton("core/resource")->getConnection('core_write');
         $table = Mage::getSingleton('core/resource')->getTableName('abc');
         $write->insert($table,array('name'=>'hello'));
     
         $write = Mage::getSingleton("core/resource")->getConnection('core_write');
        $table = Mage::getSingleton('core/resource')->getTableName('abc');
        $write->update($table,array('name'=>'abc'),array('id'=>3));
     
            $write = Mage::getSingleton("core/resource")->getConnection('core_write');
        $table = Mage::getSingleton('core/resource')->getTableName('abc');
        $write->delete($table,array('id'=>3));
     
         $read = Mage::getSingleton("core/resource")->getConnection('core_read');
        $table = Mage::getSingleton('core/resource')->getTableName('abc');
            $result = $read->select()->from(array('main_table'=>$table))->where('main_table.id',3)->limit(1);
            $products=$read->fetchAll($result);
  • 相关阅读:
    Python远程连接主机之paramiko模块
    品德养成记
    打包命令tar
    Linux内存信息查看——free命令
    机器学习之线性代数
    Linux用户信息查询
    tcpdump命令
    netstat命令
    LED的基本认识与STC89C52中的LED
    keil新建工程及工程设置
  • 原文地址:https://www.cnblogs.com/dongtong/p/5852440.html
Copyright © 2011-2022 走看看