If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > how to make automated SQL queries - user expiration

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-17-05, 13:47
noamkrief noamkrief is offline
Registered User
 
Join Date: Dec 2003
Posts: 61
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
Reply With Quote
  #2 (permalink)  
Old 10-17-05, 23:17
cornercuttin cornercuttin is offline
Registered User
 
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.
Reply With Quote
  #3 (permalink)  
Old 10-18-05, 00:50
noamkrief noamkrief is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On