Currently i have a customer form which inserts data into multiple tables. I am integrating with QuickBooks PHP-API (Consolibyte).
When the data is inserted following is the queuing method that proceeds after insertion in a table.
$Queue = new QuickBooks_WebConnector_Queue($dsn);
$Queue->enqueue(QUICKBOOKS_ADD_CUSTOMER, $id);
where $id is the last_insert_id() in a table.
Since there are entries happening to multiple tables, how do i update Customer records in Quickbooks by fetching data from multiple table since each table will return its own last insert id.
Since there are entries happening to multiple tables`
Presumably, you have a common customer_id
field or something that is shared across all tables.
Use that customer_id
value.
how do i update Customer records in Quickbooks by fetching data from multiple table
SQL supports something called JOIN
s which are specifically meant to allow you to "smush" two related tables together and get all the data related to your specific customer from all of the related tables.
Use a JOIN
. Get all the data from the tables.
Build your qbXML request from that.