예제 #1
0
function deleteuser($uid)
{
    $cn = connect_db();
    $sql = "select * from `users` where userid='" . $uid . "'";
    $link = mysql_query($sql, $cn) or die("Error : " . mysql_error());
    $num = mysql_num_rows($link);
    disconnect_db($cn);
    if ($num > 0) {
        $ans = true;
        cancelphoto($uid);
        canceldiary($uid);
        cancelmessage($uid);
        cancelfriend($uid);
        canceluser($uid);
    } else {
        $ans = false;
    }
    return $ans;
}
예제 #2
0
 function cancelaccount($ar)
 {
     $cn = connect_db();
     $sql = "select * from `users` where userid='" . $_SESSION['gallery_userid'] . "' and password='******'confirmpassword'] . "'";
     $link = mysql_query($sql, $cn) or die("Error : " . mysql_error());
     $num = mysql_num_rows($link);
     disconnect_db($cn);
     if ($num > 0) {
         $ans = true;
         cancelphoto($_SESSION['gallery_userid']);
         canceldiary($_SESSION['gallery_userid']);
         cancelmessage($_SESSION['gallery_userid']);
         cancelfriend($_SESSION['gallery_userid']);
         canceluser($_SESSION['gallery_userid']);
         $_SESSION['gallery_loginsystem'] = 0;
         $_SESSION['gallery_username'] = "";
         $_SESSION['gallery_userid'] = "";
     } else {
         $ans = false;
     }
     return $ans;
 }