Shoutbox

PHP Help - Warning: unlink(imgs/) [function.unlink]: [resolved] - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: PHP Help - Warning: unlink(imgs/) [function.unlink]: [resolved] (/showthread.php?tid=73747)

PHP Help - Warning: unlink(imgs/) [function.unlink]: [resolved] by prashker on 04-19-2007 at 06:56 PM

According to Nathan he told me to post this below since this is the erroring code thing I guess :P.

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?
RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in.... by Nathan on 04-19-2007 at 06:59 PM

Yeah,
I have never used unlink before and im not familiar with it :( Sorry.
And if you could help that'd be great :D


RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in.... by WDZ on 04-19-2007 at 07:10 PM

You just need to make sure you give unlink() the right path to the file. :p

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");


RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in by prashker on 04-19-2007 at 07:20 PM

quote:
Originally posted by WDZ
You just need to make sure you give unlink() the right path to the file. :p

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 :p.
RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in.... by Veggie on 04-19-2007 at 07:23 PM

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. :p

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 :p.
you are getting that error because you are trying to delete a dir...
RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in.... by Nathan on 04-19-2007 at 08:14 PM

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.


RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in.... by prashker on 04-19-2007 at 08:33 PM

Ok Nathan is gone so I need someone else to help :p.


RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in by L. Coyote on 04-19-2007 at 09:58 PM

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.
RE: RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in.... by WDZ on 04-19-2007 at 10:16 PM

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... :p
RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in.... by prashker on 04-19-2007 at 11:30 PM

Meh, wait for Nathans reply :p.

He might have fixed, dunno =p.

Naaathan?


RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in by prashker on 04-20-2007 at 02:54 AM

lol double post of WDZ-ness.

Whoever thinks they can help, let me know and I send you source privatelay!

edit: Thanks for fixing Weyzza :D.