Re: Hold System
| From: | Daniel Brunner | Date: | Wed, 14 Jul 2004 21:04:21 +0000 |
| Subject: | Re: Hold System | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-35258@lists.php.net to get a copy of this message | ||
Hello!!
CREATE TABLEIf it's user based, then that's easy...Have a user run some type of report, or something like that But if you/they want this automatic, then it's a little more involved... What I've done in the past..Running Linux of course... Create a mysql query text file and save it..(example) SELECT STUDENT_ID FROM hold_tracker WHERE USER_ID = 'blah' Create a bash script...(Example) #!/bin/sh # # # mysql database_name -uJoe -pblow <query | mail whatever@whatever.com -s "Student Name Has Expired" Then use CRON to start the Bash script at a certain time... Danhold_tracker(idint(11) NOT NULL auto_increment,STUDENT_IDint(11) NOT NULL default '0',USER_IDint(11) NOT NULL default '0',validchar(1) NOT NULL default '1',date_heldbigint(20) NOT NULL default '0',date_createdbigint(20) NOT NULL default '0', PRIMARY KEY (id) ) TYPE=MyISAM AUTO_INCREMENT=12 ; This works okay, for just keep track of who is holding the student. There are some restrictions: 1. A Coordinator may only hold 3 students at a time. (PHP logic, this is done already.) 2. A Coordinator can only hold a student while in the #1 position for a certain amount of time. (I don't have a problem with calculating the time.The problems are: A. What do I do with the record once there hold has expired? Who checks for this???