<?php


$column = $_POST['column'];
$stock_id = $_GET['stock_id'];
$row = $_POST['row'];


//$mysqli = new mysqli("localhost","vps10082_inspect","kw8!boB#C}_d","vps10082_oliacInspections");
$mysqli = new mysqli("localhost","vps10082_inspect","kw8!boB#C}_d","vps10082_oliacInspections");

// Check connection
if ($mysqli -> connect_errno) {
  echo "Failed to connect to MySQL: " . $mysqli -> connect_error;
  exit();
}else{

    $update = "UPDATE inspection_cars SET $column = CONCAT_WS(',', $column, '$row')   WHERE Stock_id='$stock_id'";

    if ($mysqli->query($update) === TRUE) {

      echo "Record updated successfully";

    } else {

      echo "Error updating record: " . $mysqli->error;

    }



}


?>
