Viewing file: batch_submit.php (818 B) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php // Connect to the database (you need to replace these values with your actual database details) $servername = "localhost"; $username = "itce_user"; $password = "rb!itc838"; $dbname = "itce_data";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); }
if ($_SERVER["REQUEST_METHOD"] == "POST") { $batch_name= $_POST["batch_name"]; $batch_time = $_POST["batch_time"]; $sql = "INSERT INTO batch (batch,branch) VALUES ('$batch_name', '$batch_time')";
if ($conn->query($sql) === TRUE) { echo "New record inserted successfully"; } else { echo "Error: " . $sql . "<br>" . $conn->error; } } header("Location: batch_registraion.php"); exit(); $conn->close(); ?>
|