<?php
    header('Content-Type: application/json');
    header("Access-Control-Allow-Origin: *");
    
    require '../php/database.php';

    $id = $_POST['i'];
    $color = $_POST['c'];

    $sql = "UPDATE dosingPumps SET `reservoirColor` = '$color' WHERE doseID = '$id'";
    
    if ($mysqli->query($sql) === TRUE) {
        echo "Record updated successfully";
    } else {
        echo "Error updating record: " . $mysqli->error;
    }
    
    $mysqli->close();
    