My situation is that I have data to be added in two tables Login and Customer Details in MySQL. The data is being collected by Zend Framework 2 one form and being added into Database at the same time. Both Tables in MySQL has a Customer\_ID. In both table the customer\_id is Auto increment.I want to it to be such that when add the data via the form the Customer\_ID in Customer Details is auto incremented and its value is copied onto the Login table Customer\_ID.

So far I have tried it with LastInserverValue(), I have tried making Login's Customer\_ID a FK, I have tried to manually assign the customer\_ID to Login with no luck.
With the above methods I used they only added but Customer\_ID are not the same.

Note: The data is being added not Updated.

UPDATE: I know I can get using last insert ID but because I am using two tablegateways for the two tables in ZF2 i cant figure out how to get the last insert value from tablegateway1 to tablegateway 2