<?php
require_once("dbconn.php");
require_once("phpFunctions.php");

$data_id = isset($_GET["data_id"]) ? $_GET["data_id"] : null;
$data_table = isset($_GET["data_table"]) ? $_GET["data_table"] : null;

$response = array(); 

$result = executeQuery($conn, "SELECT * FROM egg_standards WHERE id = ?", "i", [$data_id]);

if ($result === false) { 
	throw new Exception("Error executing query: " . $conn->error);
} 

if ($result->num_rows > 0) {
	while($row = $result->fetch_assoc()) 
	{
		$response["id"] = $row["id"];
	}
} 

if (empty($response)) {
	echo json_encode(["status" => "error", "message" => "esRowData - An error occurred while processing your request."]);
} else {
    echo json_encode($response);
}
?>