Showing posts with label setData method in magento. Show all posts
Showing posts with label setData method in magento. Show all posts

error in SetData method in magento

if you got the problem in setData method in magento. Than follow some step to slove this problem.

Step1:- Check your resource table name in config.xml file,and Clear your cache folder inside /var folder and than check.

Step2:- If step 1 is not working than reindex your project and than check.

Step3:- If step 1 and 2 is not working, than check your table Engine type if it's InnoDB than change it to MyISAM and than check.  
             
Hopefully your problem has been solved.
Note:-  Please take a back up before using this steps.

Clck here To know how to set data through model .

set data through model in magento

if you want to save your data in your custom model through setData(). than follow below process to save your data in custom model.


$values  = array('TABLE_COLUM_NAME_1'=>'TABLE_COLUM_Vaule_1','TABLE_COLUM_NAME_2'=>'TABLE_COLUM_Vaule_2',...);
              
 $tracking = Mage::getModel('YOUR_MODEL_PATH'); // your model object                
 $tracking->setData($values);
 $tracking->save();

Now see your value in your table.
                or
 If you want to show save current value, than use this
 print_r($tracking-getData());

Solve setData error problem in magento Click Here