0

I am little bit confuse. I am using magento orm basic like Mage::getModel('test/test') and I search that also use direct SQL query use for insert,update and delete so my question is which one is better and if I use direct SQL query so any arise security issue in future or secure direct SQL query in magento ? Which one is better both of them ? Please guide me

asked May 15, 2016 at 4:12

1 Answer 1

1

There is no problem about using direct SQL queries, if you are 100% sure which database tables you'd read or update. Most common issue here would be missing some tables to update, leading to data inconsistence

Using Magento models performs slower, but you don't have to mind which database tables might be involved in your operation

answered May 15, 2016 at 7:41
1
  • Given Magento's EAV structure, it's really easy to corrupt the database if you don't do your homework when you create your direct SQL data inserts. Commented May 16, 2016 at 3:35

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.