Magento Coding Solutions

magento reindex programmatically

for ($i = 1; $i <= 9; $i++) {
        $reIndexProcess = Mage::getModel('index/process')->load($i); $reIndexProcess->reindexAll();
}

get Last order increment id in magento

<?php
$last_order_increment_id=Mage::getModel("sales/order")->getCollection()->getLastItem()->getIncrementId();
echo $last_order_increment_id;

?>