Hello Inserter

real_escape_string($first); $last = $link->real_escape_string($last); $first = intval($first); $last = intval($last); if ($first == 0 or $last == 0) { echo 'This query will fail.'; } $query = "SET FOREIGN_KEY_CHECKS = 1"; $result = $link->query($query); if(!$result) { echo "
bad query
"; echo "
  • Failed: " . $link->errno . " " . $link->error . "
  • "; } $query = "INSERT INTO Attending (Student_ID, Class_ID) VALUES('".$first."','".$last."')"; $result = $link->query($query); $query = "SET FOREIGN_KEY_CHECKS = 0"; $result = $link->query($query); if(!$result) { echo "
    bad query
    "; echo "
  • Failed: " . $link->errno . " " . $link->error . "
  • "; } else { echo 'Student-Class inserted as: ' . $first . ' .. ' . $last; } echo '

    '; echo '

    The new attending table:

    '; include 'attending.php'; $link->close(); ?>


  • Reset the Whole DB
  • Display All
  • List Course
  • Forms for Inserting New Data