steviemac Posted August 13, 2007 Share Posted August 13, 2007 I have an on line registration for a trade school. Eventually the classes become full and the students go to a waiting list. Here is my question. If someone cancels a class, can I (with the help of code) take them from a waiting list table and and put them in the active table and then generate a email to let them know they are no longer on the waiting list and can attend the course? Even using one table with a form field that is "waiting" with a response in it. Now if someone cancels their seat the first waiting person gets a auto email saying they are accepted to the course and the "waiting" field has a different response. Something to either effect. Thank you in advance for any input Quote Link to comment https://forums.phpfreaks.com/topic/64647-wondering-if-this-is-possible/ Share on other sites More sharing options...
Orio Posted August 13, 2007 Share Posted August 13, 2007 I dont know what your table structure looks like so its hard to answer. Basically what you need to do is when someone cancels, you take the 1st one in the waiting list and put him instead of him, and email him. I know this sounds stupid and you probably thought about it yourself, but thats all I can do- you haven't supplied any code (show us the script that runs when someone cancels) or any other technical info like your table structure... Orio. Quote Link to comment https://forums.phpfreaks.com/topic/64647-wondering-if-this-is-possible/#findComment-322308 Share on other sites More sharing options...
steviemac Posted August 13, 2007 Author Share Posted August 13, 2007 This is the script. All it does is tell them they canceled and sends a email to the office manager. The office manager then sends an email to the next on the waiting list. I just wanted to ease the process and try toautomate it <?php error_reporting(E_ERROR | E_WARNING | E_PARSE); ini_set('track_errors', true); //Connect to DB $db = mysql_connect("localhost", "xxxxx", "xxxx"); mysql_select_db("xxxx"); if($_POST['submit']) { $result = mysql_query("DELETE FROM ".USERS_TABLE." WHERE id = '".$_POST['id']."'") or die(mysql_error()); echo "Your course seat has been canceled"; } else { echo 'You didnt enter any data'; } ?> email code here Quote Link to comment https://forums.phpfreaks.com/topic/64647-wondering-if-this-is-possible/#findComment-322322 Share on other sites More sharing options...
Orio Posted August 13, 2007 Share Posted August 13, 2007 Again, I cant really help you since I dont know your table structure- Where are the names of the waiting and how are they stored, as well as what columns you got there? Same goes for USERS_TABLE- Whats in it and what columns you have there? Orio. Quote Link to comment https://forums.phpfreaks.com/topic/64647-wondering-if-this-is-possible/#findComment-322335 Share on other sites More sharing options...
steviemac Posted August 13, 2007 Author Share Posted August 13, 2007 Since we do it manually everyone goes in the same table. The main reason is the courses repeat through out the year. If they are on the waiting list in April they are given a seat at the next course, so we keep the info in the table of the course. Hope it helps This is the columns mysql_query("CREATE TABLE $nametable( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), registration VARCHAR(30), Course VARCHAR(255), Seats INT, Student_1_Name VARCHAR(255), Status_Student_1 VARCHAR(255), doe_1 VARCHAR(255),///date of employment Student_2_Name VARCHAR(255), Status_Student_2 VARCHAR(255), doe_2 VARCHAR(255), Student_3_Name VARCHAR(255), Status_Student_3 VARCHAR(255), doe_3 VARCHAR(255), Agency VARCHAR(255), Contact_Person VARCHAR(255), Agency_Phone VARCHAR(255), fax VARCHAR(255), email_address VARCHAR(255), date TIMESTAMP NOT NULL)") or die(mysql_error()); echo "Table Created!"; Quote Link to comment https://forums.phpfreaks.com/topic/64647-wondering-if-this-is-possible/#findComment-322353 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.