The error is telling you that you cannot have a null value for the inventoryid column in your store order details server behavior that starts on line 178.
In this server behavior you are setting the inventoryid column to the value of the $_SESSION['inventoryid'] variable. This variable is being set to the recordset value for the inventoryID like this:
$_SESSION["inventoryid"] = "".$row_rsInventory['inventoryid'] ."";
Based on the result that you are getting it seems that this recordset is not getting a value for this column. Have you tested the recordset? It seems that there is no filtering occurring on this recordset so you would only ever get the first one in your db.
I think that if you got this recordset setting a value for the session variable it would work for you. To test if you are getting a value from the rs you can add in a die statement during the setting of this variable like this:
code starting on line 71:
if (!session_id()) session_start();
if($_SERVER["REQUEST_METHOD"] == "POST") {
$_SESSION["inventoryid"] = "".$row_rsInventory['inventoryid'] ."";
die("the value of the rsInventory.inventoryid is: " . $row_rsInventory['inventoryid'] . " and the value of the session variable inventoryid is: " . $_SESSION["inventoryid"] . "");
}
This will let you know if the value you are setting this session variable to is present and what the values are after you set the variable. If you see the correct results here the next thing to check would be the value of this session variable when the store order details is occurring. You can add in the same die statement to the top of that server behavior and comment out the one here to see what the values are at that time.