Delete user & file
Collapse
X
-
i got a branching structure inplace swell to not cause error instead itl have an error message set by me.
-
also to avoid some errors in case the file dnt exist u cld useOriginally posted by crazybrumi View Postyup you where right, i just coded and tryed this and it worked.
Code:$sql = "SELECT filename, path FROM gallery_files WHERE uid='".$who."'"; $items = mysql_query($sql); echo mysql_error(); if(mysql_num_rows($items)>0) while ($item = mysql_fetch_array($items)) { $filename=explode("gallery/",$item[0]); unlink("../gallery/$filename[0]"); }Code:if(file_exist($file)){ unlink($link_variable); }Last edited by syrus; 04.08.09, 17:14.
Leave a comment:
-
yup you where right, i just coded and tryed this and it worked.Originally posted by syrus View Postits quite easy @brumi if u do it like that only 1 record will b deleted. use a while statement but before u end it check if tha file exist then unlink. U could delete both user and file at once, send me that page n sql after work ill fix it up
Code:$sql = "SELECT filename, path FROM gallery_files WHERE uid='".$who."'"; $items = mysql_query($sql); echo mysql_error(); if(mysql_num_rows($items)>0) while ($item = mysql_fetch_array($items)) { $filename=explode("gallery/",$item[0]); unlink("../gallery/$filename[0]"); }
Leave a comment:
-
ok fine.,lol..i see..but letter n is far from letter p..mobile or pc..Originally posted by subzero View PostNo its unlink a spelling error for meLast edited by kiLLeR-eyEd_14; 04.08.09, 10:08.
Leave a comment:
-
i haven't used uplink but ok, i agree with you and subzero.,maybe you have tested it.,but also unlink is working too..That's what i use..From the word itself..Unlink..Means like to remove..Am i right?..unlink or uplink..whatever.,the important is what function will remove the file..Coz for me, unlink() works..Originally posted by mobileGIGS View Postno it suplink() haaLast edited by kiLLeR-eyEd_14; 04.08.09, 07:59.
Leave a comment:
-
-
its quite easy @brumi if u do it like that only 1 record will b deleted. use a while statement but before u end it check if tha file exist then unlink. U could delete both user and file at once, send me that page n sql after work ill fix it up
Leave a comment:
-
iv been bessing around with this all yesterday and it only deletes one when i try and make it to delete all it dosnt wana play ballPHP Code:$file=mysql_fetch_array(mysql_query("SELECT filename, path FROM gallery_files WHERE uid='".$who."'")); $nick=explode("(",$file[0]); $filename=explode("gallery/",$file[1]); unlink("../gallery/$filename[1]");
</span>
Leave a comment:
-
use this tool
uplink is a php deleting toolPHP Code:uplink("pictures/$item[0]");
also add mysql to delete the sql
Leave a comment:

Leave a comment: