$connection = Mage::getSingleton(’core/resource’)->getConnection(’core_write’); $sql = "INSERT INTO `table` SET field1 = ?, field2 = ?, ..."; $connection->query($sql, array($field1_value, $field2_value, ...)); $lastInsertId = $connection->lastInsertId(); echo $lastInsertId;
No comments:
Post a Comment