1

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

3
  • Can you give a scenario of what you are trying to achieve.
    – Marius
    Oct 3, 2013 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. Oct 3, 2013 at 8:17
  • If you can explain the whole task you wanna accomplish, we may be able to explain you clearly.
    – Shathish
    Oct 3, 2013 at 11:28

2 Answers 2

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.

1
  • found it. thx for advice! Oct 10, 2013 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);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.