to unlink files from 2 different folders in php

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Divyatamizh
New php-forum User
New php-forum User
Posts: 9
Joined: Sun Mar 03, 2013 11:56 pm

to unlink files from 2 different folders in php

Postby Divyatamizh » Fri Mar 08, 2013 1:53 am

Hi im new to php. could anyone help to figure out what is the problem with my code to unlink files from two different folders in php. In the code i can unlink image alone note the other file. :help:
Here is my code.

Code: Select all


if(isset($_GET['del']))
   {
      $emp1 = $_GET['del'];
      
      $sql1=mysql_query("Select * from emp_tbl where id=$emp1");
      

      while($row=mysql_fetch_array($sql1))
      {         
         $del_poto=$row['photo'];
         unlink("uploads/$del_poto");

         $del_res=$row['resume'];
         unlink("Resume/$del_res");
      }      



johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: to unlink files from 2 different folders in php

Postby johnj » Sun Mar 10, 2013 6:34 am

unlink deletes a file and rmdir removes a directory. Please check the php manual.


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 2 guests

cron