Scan Database for expired accounts and emial user

Codes here !

Moderators: egami, macek, gesf

Post Reply
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 824
Joined: Sun Jun 02, 2002 3:09 am

Wed Nov 20, 2002 2:52 am

<?
mysql_connect("localhost", "pejone", "pejone");
mysql_select_db("dreamstan");

$date=date("m-d-y");
$today=explode("-", $date);

$days = date ("Y-m-d", mktime (0,0,0, $today['0'], $today[1]-3, $today[2]));

$query=mysql_query("SELECT * FROM `news` WHERE `date` < '$days' AND `is_1_email_send`= '0' ");

while($data=mysql_fetch_array($query))
{
//dont forget to update your data base
//mail function here "$data[email]";
}

?>

<!--include this script to your index page or some of the most popular/viseted pages =) -->

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests