Unstoppable Domains โ€” Expired Auctions

Unlink - Need help

Spacemail by SpaceshipSpacemail by Spaceship
Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Watch

bluemouse2

Established Member
Impact
10
Hi!
Can you please help me delete several files with unlink?
php Code:

PHP:
 $sql = "select filename from $aaa where owner='$id'";
   $result = mysql_query($sql) or die("Failed: $sql");
   $resrow = mysql_fetch_row($result);
 $filename = $resrow[0];
 @unlink("./files/".$filename);


this code deletes only one file.
there are several files to delete.

where do i go wrong? thanks.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
PHP:
 $sql = "select filename from $aaa where owner='$id'";
   $result = mysql_query($sql) or die("Failed: $sql");
  while ($row = mysql_fetch_array($result)) {
        @unlink("./files/".$row[0]);
}

Try this
 
Last edited:
1
•••
Thank you!
 
0
•••
no prob.
You can / should use mysql_fetch_row like you did in your code since your going to return an enumerated array
 
0
•••
The @ opertor is extremely slow. It'd be best if you checked if the result file existed, and then unlinked it.
 
0
•••
its not extermely slow ... it's slower.
 
0
•••
Olitt โ€” high-converting AI websites, only from $1/moOlitt โ€” high-converting AI websites, only from $1/mo
Escrow.com
Spaceship
Domain Recover
CryptoExchange.com
Catchy
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back