Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Creating new database table from the action of an Controller
 
Drk_alien
Jr. Member
 
Total Posts:  7
Joined:  2012-10-14
 

Hy,
I want to develop an extension and i’m facing some problems. In admin side.
I need to create a new table in mageno’s database. How i do that from here (from an action ):

class Name_Example_AdminControllersHere_TestController extends Mage_Adminhtml_Controller_Action
{
    
public function addtableAction()
    
{
           
///how i create a new table here?
        
}
      
public function getFromTableAction()
    
{
           
///how i get data from the table  $data =$some-> getData();
           ///how the .phtml file will reconize the array  $data ?
        
}
}
The 2’nd problem, of course is how i get some data from the created table and how i can display this data into .phtml file ?
Consider that i’m using the same controller but another action.
And how i can get the same data directly from .phtml file ?.

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Magikvishal
Sr. Member
 
Total Posts:  278
Joined:  2012-06-12
 

Hello i think first you understand magento module flow you will search magento online module creator
its very fast & easy to create custom module then you get proper idea about magento module

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top