It looks like you are trying to set the order id to $row_rsOrders['orderid']. The id of your orders table should be set to an auto incrementing primary key column that is not null. If you have the orders table setup like this then the id will not need to be explicitly inserted for the order. You could choose to add another column to store the order reference id, this should be the session id that you can get from the bindings in eCart > [Session ID].