Delete user & file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • crazybrumi
    replied
    i got a branching structure inplace swell to not cause error instead itl have an error message set by me.

    Leave a comment:


  • syrus
    replied
    Originally posted by crazybrumi View Post
    yup 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]");
        }
    also to avoid some errors in case the file dnt exist u cld use
    Code:
     if(file_exist($file)){ unlink($link_variable); }
    Last edited by syrus; 04.08.09, 17:14.

    Leave a comment:


  • crazybrumi
    replied
    Originally posted by syrus View Post
    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
    yup 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]");
        }

    Leave a comment:


  • kiLLeR-eyEd_14
    replied
    Originally posted by subzero View Post
    No its unlink a spelling error for me
    ok fine.,lol..i see..but letter n is far from letter p..mobile or pc..
    Last edited by kiLLeR-eyEd_14; 04.08.09, 10:08.

    Leave a comment:


  • subzero
    replied
    No its unlink a spelling error for me

    Leave a comment:


  • kiLLeR-eyEd_14
    replied
    Originally posted by mobileGIGS View Post
    no it suplink() haa
    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..
    Last edited by kiLLeR-eyEd_14; 04.08.09, 07:59.

    Leave a comment:


  • subzero
    replied
    geez i must be true nub spelling yeah its unlink

    Leave a comment:


  • CreativityKills
    replied
    no it suplink() haa

    Leave a comment:


  • kiLLeR-eyEd_14
    replied
    Originally posted by subzero View Post
    uplink is right ;)
    it's unlink..

    Leave a comment:


  • syrus
    replied
    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:


  • crazybrumi
    replied
    sub isnt it unlink not uplink if you wna delete

    Leave a comment:


  • subzero
    replied
    uplink is right ;)

    Leave a comment:


  • crazybrumi
    replied
    PHP 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]"); 
    
    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 ball
    </span>

    Leave a comment:


  • morse
    replied
    PHP: unlink - Manual

    Subzero might have typed it wrong in a hurry

    Leave a comment:


  • subzero
    replied
    use this tool

    PHP Code:
    uplink("pictures/$item[0]"); 
    
    uplink is a php deleting tool

    also add mysql to delete the sql

    Leave a comment:

Working...
X