PHP Help - Warning: unlink(imgs/) [function.unlink]: [resolved] |
Author: |
Message: |
prashker
Veteran Member
Posts: 5109 Reputation: 104
– / / –
Joined: Mar 2005
Status: Away
|
O.P. PHP Help - Warning: unlink(imgs/) [function.unlink]: [resolved]
According to Nathan he told me to post this below since this is the erroring code thing I guess .
code: $actual variable name here = mysql_fetch_array($other variable name);
unlink("{$actual variable name['row title goes here']}");
Anyways. Basically, in my admin panel I have a delete button which is supposed to delete the image file. But it only deletes it from the database list, but the file is still online and works. You just cannot see it in the admin panel anymore.
This is the error code
code: Warning: unlink(imgs/) [function.unlink]: No such file or directory in /home/sonicsam/public_html/jesuswasajew/adminx/index.php on line 53
Anybody with the powers to help ;o?
This post was edited on 04-20-2007 at 08:32 PM by prashker.
|
|
04-19-2007 06:56 PM |
|
|
Nathan
Veteran Member
Yeah, "large dimensions" ;)
Posts: 2984 Reputation: 76
– / /
Joined: Apr 2005
|
RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in....
Yeah,
I have never used unlink before and im not familiar with it Sorry.
And if you could help that'd be great
|
|
04-19-2007 06:59 PM |
|
|
WDZ
Former Admin
Posts: 7106 Reputation: 107
– / /
Joined: Mar 2002
|
RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in....
You just need to make sure you give unlink() the right path to the file.
If you're using a relative path, and currently in the /adminx/ directory, you'll need to use "../imgs/" instead of "imgs/"
unlink("../imgs/loljesus.jpg");
|
|
04-19-2007 07:10 PM |
|
|
prashker
Veteran Member
Posts: 5109 Reputation: 104
– / / –
Joined: Mar 2005
Status: Away
|
O.P. RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in
quote: Originally posted by WDZ
You just need to make sure you give unlink() the right path to the file.
If you're using a relative path, and currently in the /adminx/ directory, you'll need to use "../imgs/" instead of "imgs/"
unlink("../imgs/loljesus.jpg");
Warning: unlink (../imgs/) [function.unlink]: Is a directory in /home/sonicsam/public_html/jesuswasajew/adminx/index.php on line 53
Still does not work, but I saw a change, see bold .
This post was edited on 04-19-2007 at 07:20 PM by prashker.
|
|
04-19-2007 07:20 PM |
|
|
Veggie
Full Member
Posts: 415 Reputation: 21
37 / /
Joined: Sep 2004
|
RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in....
quote: Originally posted by SonicSam
quote: Originally posted by WDZ
You just need to make sure you give unlink() the right path to the file.
If you're using a relative path, and currently in the /adminx/ directory, you'll need to use "../imgs/" instead of "imgs/"
unlink("../imgs/loljesus.jpg");
Warning: unlink(../imgs/) [function.unlink]: Is a directory in /home/sonicsam/public_html/jesuswasajew/adminx/index.php on line 53
Still does not work, but I saw a change, see bold .
you are getting that error because you are trying to delete a dir...
|
|
04-19-2007 07:23 PM |
|
|
Nathan
Veteran Member
Yeah, "large dimensions" ;)
Posts: 2984 Reputation: 76
– / /
Joined: Apr 2005
|
RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in....
well it should be finding a row in the db where a certian id matches the id its deleting.
But it doesnt seem to be working.
|
|
04-19-2007 08:14 PM |
|
|
prashker
Veteran Member
Posts: 5109 Reputation: 104
– / / –
Joined: Mar 2005
Status: Away
|
O.P. RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in....
Ok Nathan is gone so I need someone else to help .
|
|
04-19-2007 08:33 PM |
|
|
L. Coyote
Senior Member
Captain Obvious
Posts: 981 Reputation: 49
39 / /
Joined: Aug 2004
Status: Away
|
RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in
quote: Originally posted by SonicSam
$actual variable name here = mysql_fetch_array($other variable name);
unlink("{$actual variable name['row title goes here']}");
For the "row title" to work, shouldn't it be "fetch_assoc" and not "fetch_array"?
Edit: I really don't remember, as I haven't used fetch_array for years, so don't bite my head off for it.
This post was edited on 04-19-2007 at 10:00 PM by L. Coyote.
Hack, hack, hack!
Finally became a Systems Analyst!
|
|
04-19-2007 09:58 PM |
|
|
WDZ
Former Admin
Posts: 7106 Reputation: 107
– / /
Joined: Mar 2002
|
RE: RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in....
quote: Originally posted by L. Coyote
For the "row title" to work, shouldn't it be "fetch_assoc" and not "fetch_array"?
No, that won't matter... both functions return associative indices. The difference is that fetch_assoc() only returns associative indices, while fetch_array() can return numeric indices as well.
quote: Originally posted by Nathan
well it should be finding a row in the db where a certian id matches the id its deleting.
But it doesnt seem to be working.
So the query isn't matching any rows? The relevant code hasn't even been posted here, so it would take a psychic to figure out what the problem is...
|
|
04-19-2007 10:16 PM |
|
|
prashker
Veteran Member
Posts: 5109 Reputation: 104
– / / –
Joined: Mar 2005
Status: Away
|
O.P. RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in....
Meh, wait for Nathans reply .
He might have fixed, dunno =p.
Naaathan?
|
|
04-19-2007 11:30 PM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|