1

I want a helper which will save only one specific column in database table(not eav).

  • Can you give a scenario of what you are trying to achieve. – Marius Oct 3 '13 at 8:14
  • For example i have a table with a column named 'flag'.. and i want to update only the value in 'flag' without having to save the whole row. – user2656802 Oct 3 '13 at 8:17
  • If you can explain the whole task you wanna accomplish, we may be able to explain you clearly. – Shathish Oct 3 '13 at 11:28
0

Study Magento DB classes and use them. They extend Zend DB adapters so you can do the same things. If data you want to save is part of a model, then you can safely set Model entity id and the updated field and save.

| improve this answer | |
  • found it. thx for advice! – user2656802 Oct 10 '13 at 10:11
0

not 100% sure if you mean that but maybe you want to do it directly like that:

/**
 * Get the resource model
 */
$resource = Mage::getSingleton('core/resource');

/**
 * Retrieve the write connection
 */
$writeConnection = $resource->getConnection('core_write');

/**
 * In your case I guess UPDATE something
 */ 
$query = "some-sql-query;

/**
 * Execute the query
 */
$writeConnection->query($query);
| improve this answer | |

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.