Re: Re: Need help for $unlink

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello man

$image_obj=mysql_fetch_object($query);

just fetches single record at a time . You need to go thorugh a while() and in the while put the unlink(). So it will delete each image . The Delete query will delete all the records.. 

You need to refer php.net , mysql etc and learn the basics ..

Warm regards,
    Hari K T
    Calicut 
    KERALA.
    +91-9895-195901

    http://www.harikt.co.nr/
    http://www.ijust4u.blogspot.com/
    http://www.phphelps.freezoka.com/





--- On Tue, 6/1/09, arvindsri123 <arvindsri123@xxxxxxxxx> wrote:

> From: arvindsri123 <arvindsri123@xxxxxxxxx>
> Subject:  Re: Need help for $unlink
> To: php-objects@xxxxxxxxxxxxxxx
> Date: Tuesday, 6 January, 2009, 3:37 PM
> Hello,
> 
> Actually I have 10 columns like Image_1, Image_1,
> Image_1...Image_10.
> 
> when i am trying to unlink its deleting only one iamge at a
> time,  i
> want to delete all images from all columns,
> 
> may send ur script again based on my requirement.
> 
> Thanks,
> AAvi
> 
> --- In php-objects@xxxxxxxxxxxxxxx,
> "avishek_mca84"
> <avishek_mca84@...> wrote:
> >
> > > Hi Rajesh 
> > > i think u r using wrong code for deleting the
> image
> > > u should uuse this code for deleteting the image
> and the record from
> > data base
> > >
> > 
> > <?php
> >  $m_id = $_REQUEST['m_ id'];
> >  $query = "select * FROM model_photos WHERE
> m_id='$m_id' ";
> > $image_obj=mysql_fetch_object($query);
> > unlink("uploads/$image_obj->image");
> > 
> > $query1 = "DELETE FROM model_photos WHERE
> m_id='$m_id' ";
> >  $result1 = mysql_query( $query1) or die('Query
> failed: ' .
> > mysql_error( ));
> > >
> > > 
> > i think this will help u better.
> > thanks
> > Avishek Kumar(9748141833)
> > Web Developer
> > Nettrackers
> > Kolkata
> >


      Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux