Welcome Guest, Not a member yet? Register   Sign In
unlink() function not worked
#1

[eluser]harris_priambudi[/eluser]
I want to delete data from database and delete image file at once in one models..
when its execute
delete data from database succes, but the image file still exist from the folder where I used to stored image file data..
there is the models code:

Code:
$location_logo="http://localhost/jobtagger_ci/file_data/logo/logo.png";
$lowongan=$this->input->post('id');

$tables = array('lowongan_data', 'lamaran_data');
$this->db->where('lowongan_id', $lowongan);
$this->db->delete($tables);
       unlink($location_logo);

im sorry for my bad english.. thanks for attention and ur help
#2

[eluser]kreamik[/eluser]
as far as i know .. never put url when unlink a file ..
how do you think if we can clear any pictures on google site by this way .. they can be very mad .. Big Grin
#3

[eluser]harris_priambudi[/eluser]
can you give an example for the right code??
#4

[eluser]kreamik[/eluser]
this is path :
C:\Documents\pictures.jpg
/home/kreamik/photos/pictures.jpg

this is url :
http://kreamik/pictures.jpg

right:
Code:
unlink('C:\Documents\pictures.jpg');
unlink('/home/kreamik/photos/pictures.jpg');

wrong:
Code:
unlink('http://kreamik/pictures.jpg');

*smoga_berhasil




Theme © iAndrew 2016 - Forum software by © MyBB