Wednesday, 24 April 2013

Funny Pinterest widget


PHP Date functionality

<?php echo $date= date('Y-m-d h:i:s'); echo "
"; echo $validity=30; echo "
"; echo date ("Y-m-d h:i:s", mktime (date('h'),date('i'),date('s'),date('m'),date("d")+$validity,date('Y'))); ?>

To get distance based on latitude & longitude calculate in Mysql query

SELECT DISTINCT ( a.categoryID ), a.categoryName, a.imgFile, MIN( 3959 * ACOS( COS( RADIANS( 11.0168445 ) ) * COS( RADIANS( c.lattitude ) ) * COS( RADIANS( c.longitude ) - RADIANS( 76.9558321 ) ) + SIN( RADIANS( 11.0168445 ) ) * SIN( RADIANS( 11.0168445 ) ) ) ) AS distance

Pinterest


Pinterest Widget