Hi Arvind, You have to use below: <?php $sql="select * from model_photos where m_id='$m_id' LIMIT 1"; $result=@mysql_ query($sql) ; $rows=@mysql_ num_rows( $result); $filename = mysql_result($result, 0, 'image'); if (file_exists("../uploads/ ".$filename)) { unlink("../uploads/ ".$filename); } else { echo "Arvind...You dont have folder permission so, give chmod 777 ./uploads "; } ?> Thanks & Regards Udayakumar Sarangapani Sr. PHP Developer CompIndia Infotech Pvt. Ltd. Chennai. "Science is nothing but logic..." ________________________________ From: arvindsri123 <arvindsri123@xxxxxxxxx> To: php-objects@xxxxxxxxxxxxxxx Sent: Saturday, 3 January, 2009 1:01:39 PM Subject: Re: Need help for $unlink Hi, When I am using code which u have posted here <?php $sql="select * from model_photos where m_id='$m_id' "; $result=@mysql_ query($sql) ; $rows=@mysql_ num_rows( $result); $all_result= @mysql_fetch_ array($result) ; $f1=$all_result[ 'image']; unlink("../uploads/ ". $f1); ?> I am getting this error... Warning: unlink(../uploads/ ) [function.unlink] : Permission denied in C: may u help in this, where i am wrong, i m working on localhost. Thanks, Avi Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/ [Non-text portions of this message have been removed]