set page layout by coding in Magento

In this article learn how to set product page layout by coding in Magento store.

In magento store product page design select 'no layout updates' so product page not open, then select '1 column' in product information > Design.

So many product in store if you select manually then more time consuming.
Here is code run in root directory and all product set in 1 column. When run file so take time for running. 

Here is full code....
$prdcoll = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*');
foreach( $prdcoll as $prd )
 catch (Exception $e) 
  echo 'Caught exception: ',  $e->getMessage(), "\n";