var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: how to make automated SQL queries - user expiration
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?
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.
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