Hello,
I need a script that checks the databases date colum and send a mail when one year has passed, is it very difficult to do something like that? How do I do that? (it's a linux/unix server)

Is it more simple to make a php script that does that when I start it? If, How do I do that?

Any help is appreciated, just point me in the right direction : )

Thanks in advance,
Oskar R

    A script like this would be pretty easy to do...how about posting where you are with it and people will help you out.

    // search table - return whatever you need
    //mail
    foreach ($results as $result) {
     mail($to, $subject, $message, $headers);
    }
    

    You'll need CRON to run the script.

      I have the same problem,
      how can be done search before foreach ($results as $result) if I have field dates? Need help...

        Surely you know how to query your table don't you?

          Problem is if I have many fileds like ID of task and it should get only those where are dates more than particular date.
          Is this ok? need help

          $tasks = mysql_table("SELECT * FROM tasks WHERE dates < "time ()" ORDER BY dates DESC", $db);

          foreach($tasks as $key => $task) {  $task ['ID'] }

            Have you tested that? It looks like a good place to start to me. However, I'm not sure that you are returning $tasks properly - you'll need it to be an array.

              Surely you know how to query your table don't you? > No, sorry, I'm not that good at php so I really need your help!

              Hello,
              This is the only things I've written:

              <?php
              $dbname = "hoster";
              $dbuser = "hoster";
              $dbpass = "hoster";
              $dbhost = "localhost";

              $connect = mysql_connect ($dbhost,$dbuser,$dbpass) or die("Could not connect to the database! ".mysql_error());
              mysql_select_db($dbname,$connect) or die("Could not select database! ".mysql_error());

              $date = date("Y-m-d");

              $query = "SELECT date FROM multihoster ORDER BY date DESC;";
              $result = mysql_query($query);
              echo $result;
              ?>

              I now, it's completely wrong but anyway, I want it to list the fields with a date older than one year. In other words, I need it to check all accounts and the echo which accounts are older than one year.

              Isn't it possible to use that if prefix, "if one year or older"?

              Thanks for your help
              Best Regards
              Oskar R

                vaaaska wrote:

                However, I'm not sure that you are returning $tasks properly - you'll need it to be an array.

                Do you know how to get with arrays particular fields from these dates?

                  Write a Reply...