How to save data in magento ?

for saving data in magento you have to make model

example


$model = $this->getMedel('yourmodel/yourmodel');

after you have to make an array of data

example

if i have table and has a field name and number then


$data = array('name'=>value,'number'=>value);

and then set the data and save the data using model


$model->setData($data);
$model->save();

thanks

Posted in Magento. 1 Comment »

One Response to “How to save data in magento ?”

  1. pravesh Says:

    Fatal error: Call to a member function setData() on a non-object in


Speak Your Mind

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: