1

I have the following code in my install to create a table:

$installer->run(
    "CREATE TABLE IF NOT EXISTS `npcallnations_orders` (
        `id` INT AUTO_INCREMENT,
        `order` int,
        `status` int,
        `real_order_id` int,
        `customer` varchar(245),
        `fatdir` int,
        `created_at` DATETIME null,
        PRIMARY KEY (ID)
    )"
);

but if the magento has a table prefix, it will return an error when I try to use the collection. How can I do it so it will create correctly with prefix?

1

You can use:

Mage::getSingleton('core/resource')->getTableName('npcallnations_orders')
  • where exactly...? – Stordon Oct 30 '17 at 13:49
  • Replace npcallnations_orders by that – Aurélien Oct 30 '17 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.