I am running this code and it worked for me but added error in error log
$installer = new Mage_Core_Model_Resource_Setup();
$installer->startSetup();
$installer->run("
DROP TABLE IF EXISTS {$installer->getTable('test')};
CREATE TABLE {$installer->getTable('test')} (
ci tinyint(3) unsigned NOT NULL auto_increment,
cc char(2) NOT NULL,
cn varchar(50) NOT NULL,
PRIMARY KEY (ci)
) AUTO_INCREMENT=1 ;
");
$installer->endSetup();
but is generating error in error log.
Warning: Missing argument 1 for Mage_Core_Model_Resource_Setup::__construct(), called in /opt/lampp/htdocs/magento_9_1_3/app/code/local/Namespace/Modulename/controllers/Adminhtml/tesController.php on line 512 and defined in /opt/lampp/htdocs/magento_9_1_3/app/code/core/Mage/Core/Model/Resource/Setup.php on line 127 2017-01-09T12:49:41+00:00 ERR (3): Notice: Undefined variable: resourceName in /opt/lampp/htdocs/magento_9_1_3/app/code/core/Mage/Core/Model/Resource/Setup.php on line 130
any idea how remove this error?