1) You should snot set the fkey column to be a foreign key type in the table itself.
this is not needed to _use_ the column as a foreign key column.
2) The error is saying theat the session $_SESSION['CustomerID'] does not have a value.
you can try adding:
<?php if(!session_id()) session-start(); ?> at line one of the page, if that does not work, track down where $_SESSION['CustomerID'] is supposed to get set to look into why iot is not getting set.