Jump to content
php.lv forumi
Sign in to follow this  
ppc

Jautājums par dzēšanu pēc noteikta laika

Recommended Posts

Sveiki, gribēju jautāt, vai tādā veidā var dzēst lietotājus automātiski, ja ir kļūda, lūdzu palīdiet to labot.

$del_time = time() - 43200;
if (''.$del_time.''){

$id = abs(intval($_GET['id']));
$a = $db->query("SELECT `id`,`foto` FROM `ankets` WHERE `id`='$id'")->fetch_assoc();
$b = $db->query("SELECT `id`,`file` FROM `mail_msg` WHERE `id`='$id'")->fetch_assoc();

$db->query("DELETE FROM `mail_msg` WHERE `user_2` = '$id'");
$db->query("DELETE FROM `mail_msg` WHERE `user_1` = '$id'");
$db->query("DELETE FROM `notice` WHERE `to` = '$id'");
$db->query("DELETE FROM `friend` WHERE `user2` = '$id'");
$db->query("DELETE FROM `friend` WHERE `user1` = '$id'");
$db->query("DELETE FROM `users_likes` WHERE `user` = '$id'");
$db->query("DELETE FROM `users_likes` WHERE `to` = '$id'");
if (!empty($a[foto])) unlink($a[foto]);
if (!empty($b[file])) unlink($b[file]);
$db->query('DELETE FROM `ankets` WHERE `id` = "'.$id.'"');
}

Share this post


Link to post
Share on other sites

Var nedzēst lai saglabājas vēsturei, pieliec aktivitātes pazīmi un uzseto 0, ja dzēst. Kad jāatlasa atlasa visu kam aktīvs 1. Īsti nav tas ko autors vēlas, bet var padomāt ārpus kastes.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×