Is it feasible to create a scheduling system using PHP and MySQL for a company's monthly duty roster?

To create a scheduling system using PHP and MySQL for a company's monthly duty roster, you can design a database schema to store employee information, duty assignments, and schedules. Use PHP to create a web interface for administrators to input and update duty assignments, and for employees to view their schedules. Utilize MySQL queries to retrieve and display the relevant information based on the selected month and employee.

<?php
// Connect to MySQL database
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "duty_roster";

$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

// Retrieve duty assignments for selected month and employee
$selected_month = $_POST['month'];
$selected_employee = $_POST['employee'];

$sql = "SELECT * FROM duty_assignments WHERE month = '$selected_month' AND employee_id = '$selected_employee'";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    // Output data of each row
    while($row = $result->fetch_assoc()) {
        echo "Date: " . $row["date"] . " - Shift: " . $row["shift"] . "<br>";
    }
} else {
    echo "No duty assignments found for selected month and employee.";
}

$conn->close();
?>