Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Posts
    61

    Unanswered: how to make automated SQL queries - user expiration

    Hello everyone.
    First of all i'd like to mention that this forum has been extremely helpful to me!

    I run a userbased subscription website. MYSQL and PHP

    on the user table I have fields such as F_NAME etc.... and also an EXPIRE feild.

    When the user tries to logon and goes to the logon script checkuser.php they cannot logon when EXPIRE is less than now()

    So - here is my dillemma:
    For a user to find out that their subscription period has expired, they must try to logon and then they'll get the message.

    But how do i make it so they automatically receive an email when their subscription date has passed by?

    This must be a totally seperate process that has to run on the server I assume. Maybe a batch script of some sort that goes to the MYSQL database and checks????

    How does this usually work?

    Thanks
    Noam

  2. #2
    Join Date
    Aug 2005
    Location
    Oklahoma
    Posts
    9
    you are kind of in luck. you are wanting what is called a "trigger", and the newest mysql 5 is supposed to have triggers. the downside is upgrading.

    triggers are automated responses that the mysql server does. they have a down side, the more triggers, the slower your server, so its a give and take as far as they go.

  3. #3
    Join Date
    Dec 2003
    Posts
    61
    yep - i didn't know what it was called but yes - a trigger is what i needed.

    But I refuse to upgrade to mysql 5.
    I'm using mysql 4 I think and it works fine so I don't want to try to "fix it if it aint broken"

    Also, the mysql database is already pretty slow. I have over 5000 rows in my main table and it takes about 3-4 seconds to run a query on those....

    I don't want things getting any slower

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •