B
|
Bebel author 3/3/2006 |
Hello fellow blessed people of the phpRunner world, I have a quick question and hopefully any of you would lend a hand to help: I am building a very small and simple class registration application for student. The main feature I want to have implemented is to have students view the list of classes and click on those they are interested in and register in them (just like a shopping cart). That, I can do. I need help in resolving schedule conflicts though. I have assigned a time_code to each class that indicate it's time, day and session. Therefore, if a student select any 2 classes that have the same time_code, the system warns him that there is time conflict and he has to select another class. My question is, how can I use phprunner to manage the time conflict situation using the "time_code" I have have assigned. Thank you A newbie in the block
|
![]() |
Sergey Kornilov admin 3/6/2006 |
Bebel, function BeforeAdd(&$values) { global $conn; $strSQLExists = "select * from AnyTable where time_code=".$values["time_code"]; $rsExists = db_query($strSQLExists,$conn); $data=db_fetch_array($rsExists); if($data) { // if record exists do something echo "Warning!!" } else { // if dont exist do something else } return true; }
|