Skip to main content
added 140 characters in body
Source Link
Amit Bera
  • 77.7k
  • 20
  • 124
  • 239

I have try it too hard you need to by insert direct query

$write = Mage::getSingleton("core/resource")->getConnection("customer_group");
$query =
"INSERT INTO `customer_group`(`customer_group_id`, `customer_group_code`, `tax_class_id`) VALUES (:customer_group_id,:customer_group_code,:tax_class_id)";
$binds = array(
    'customer_group_id'      => 100,
    'customer_group_code'     => "Partners",
    'tax_class_id'   => 5,
);

$write->query($query, $binds);

OR

You need disabled key

$this->_isPkAutoIncrement = false;

http://watson-net.com/blog/magento-database-model-primary-keys/

I have try it too hard you need to by insert direct query

$write = Mage::getSingleton("core/resource")->getConnection("customer_group");
$query =
"INSERT INTO `customer_group`(`customer_group_id`, `customer_group_code`, `tax_class_id`) VALUES (:customer_group_id,:customer_group_code,:tax_class_id)";
$binds = array(
    'customer_group_id'      => 100,
    'customer_group_code'     => "Partners",
    'tax_class_id'   => 5,
);

$write->query($query, $binds);

I have try it too hard you need to by insert direct query

$write = Mage::getSingleton("core/resource")->getConnection("customer_group");
$query =
"INSERT INTO `customer_group`(`customer_group_id`, `customer_group_code`, `tax_class_id`) VALUES (:customer_group_id,:customer_group_code,:tax_class_id)";
$binds = array(
    'customer_group_id'      => 100,
    'customer_group_code'     => "Partners",
    'tax_class_id'   => 5,
);

$write->query($query, $binds);

OR

You need disabled key

$this->_isPkAutoIncrement = false;

http://watson-net.com/blog/magento-database-model-primary-keys/

Source Link
Amit Bera
  • 77.7k
  • 20
  • 124
  • 239

I have try it too hard you need to by insert direct query

$write = Mage::getSingleton("core/resource")->getConnection("customer_group");
$query =
"INSERT INTO `customer_group`(`customer_group_id`, `customer_group_code`, `tax_class_id`) VALUES (:customer_group_id,:customer_group_code,:tax_class_id)";
$binds = array(
    'customer_group_id'      => 100,
    'customer_group_code'     => "Partners",
    'tax_class_id'   => 5,
);

$write->query($query, $binds);