SnickersTK
01-13-2007, 01:42 PM
been making this code and I admit that I am very new to mysql, so it might not make sense.
I haven't dared to try it out.
<?php
$connection = mysql_connect("localhost", "username", "password");
mysql_select_db("database", $connection); //connect to server and select database
require ("global.php");
$time = time() - (60 * 24 * 60 * 60);
$userid_result = query("SELECT `userid` '
. ' FROM `user` '
. ' WHERE `pmtotal` = 1 '
. ' INTERSECT '
. ' Select `fromuserid` '
. ' FROM `pmtext` '
. ' WHERE `dateline` < $time");
//Make sure that the user-ids selected with 1 total PM only gets choosen if the PM is 60 days old.
$sql = ' TRUNCATE `*` '
. ' FROM `pm` '
. ' WHERE `userid` = $userid_result';
$sql = 'TRUNCATE `*` '
. ' FROM `pmtext` '
. ' WHERE `fromuserid` = $userid_result';
MySQL_query($sql) or die('MySQL Failed Because: ' . mysql_error());
?>
Any assistance is greatly appreciated. I think it is a nice hack. I am running a giant board and all members who signs up gets an welcome PM (very popular and I don't want to get rid of it)
I haven't dared to try it out.
<?php
$connection = mysql_connect("localhost", "username", "password");
mysql_select_db("database", $connection); //connect to server and select database
require ("global.php");
$time = time() - (60 * 24 * 60 * 60);
$userid_result = query("SELECT `userid` '
. ' FROM `user` '
. ' WHERE `pmtotal` = 1 '
. ' INTERSECT '
. ' Select `fromuserid` '
. ' FROM `pmtext` '
. ' WHERE `dateline` < $time");
//Make sure that the user-ids selected with 1 total PM only gets choosen if the PM is 60 days old.
$sql = ' TRUNCATE `*` '
. ' FROM `pm` '
. ' WHERE `userid` = $userid_result';
$sql = 'TRUNCATE `*` '
. ' FROM `pmtext` '
. ' WHERE `fromuserid` = $userid_result';
MySQL_query($sql) or die('MySQL Failed Because: ' . mysql_error());
?>
Any assistance is greatly appreciated. I think it is a nice hack. I am running a giant board and all members who signs up gets an welcome PM (very popular and I don't want to get rid of it)