/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<? include('connect.php'); $name = $_POST['coursecode']; $time = $_POST['time']; $day = $_POST['day']; $fid = $_GET['id']; echo $var4; echo $name." at ".$time." Days of: ".$day."<br>"; $pulldata = "Select * from class where className ='".$name."'"; echo $pulldata . "<br><br>"; $insertdata = "INSERT into class (className,day,time) VALUES ('" . $name . "','" . $day . "','" . $time . "')"; echo $insertdata; // Insert the class into the enrollment table $enrollQuery = "Insert into enrollment (className, fid) Values ('".$name."', '".$fid."')"; { echo "<br><br>Class Has been added to the database"; echo "<br><br>"; echo "Added to Enrollment Table :)";; } else { echo "<br>Your class has already been added!"; echo $name; } ?>