Explain how to write custom sql query in magento?



Explain how to write custom sql query in magento?..

Answer / Ashutosh Kumar Jatav

To write a custom SQL query in Magento, you can use the resource model. Here's an example:n1) In your model class, declare a resource model:nt$resource = $this->getResource();n2) Then call the query method on the resource model:nt$connection = $resource->getConnection();n3) Finally, execute your custom SQL query:nt$result = $connection->query($sql);

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Magento PHP Interview Questions

How to check magento version?

1 Answers  


How to upgrade magento?

1 Answers  


Why is magento best?

1 Answers  


How much is magento per month?

1 Answers  


How to run custom query in magento?

1 Answers  


how to create a featured product?

1 Answers  


How to upgrade to the latest version using magento connect?

1 Answers  


How do you pronounce magento?

1 Answers  


What was the initial release date of magento?

1 Answers  


Write a query to get product details with id in magento?

1 Answers  


Which language is used in magento?

1 Answers  


What language is magento written in?

1 Answers  


Categories