Magento execute custom query

How to magento execute custom query?In here you can execute custom query to insert,update,delete and fetch data from database with using magento existing database connection.

Magento get order increment id

How can you get order increment id/last order id in magento? You can get magento order increment id/last order id into the success.phtml page by this method.Also you can get magento order increment…