Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Untitled Document</title>
- </head>
- <body>
- <?php
- $servername = "localhost";
- $username = "playground18";
- $password = "Cdz5SOVrY2p8fnWS";
- $dbname = "playground18";
- $t = $_GET['teacher'];
- $s1 = $_GET['s1'];
- $s2 = $_GET['s2'];
- $s3 = $_GET['s3'];
- $s4 = $_GET['s4'];
- $s5 = $_GET['s5'];
- $s6 = $_GET['s6'];
- try
- {
- $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
- $sql = "UPDATE tanay_open_house SET student1 = '$s1' WHERE teacher='$t'";
- $conn->exec($sql);
- $sql = "UPDATE tanay_open_house SET student2 = '$s2' WHERE teacher='$t'";
- $conn->exec($sql);
- $sql = "UPDATE tanay_open_house SET student3 = '$s3' WHERE teacher='$t'";
- $conn->exec($sql);
- $sql = "UPDATE tanay_open_house SET student4 = '$s4' WHERE teacher='$t'";
- $conn->exec($sql);
- $sql = "UPDATE tanay_open_house SET student5 = '$s5' WHERE teacher='$t'";
- $conn->exec($sql);
- $sql = "UPDATE tanay_open_house SET student6 = '$s6' WHERE teacher='$t'";
- $conn->exec($sql);
- }
- catch(PDOException $e)
- {
- echo "Error: " . $e->getMessage();
- }
- $conn = null;
- header('Location: openHouseHome.php');
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement