I have two php applications that deal with same products, one is shopping and the other is point of sale but each one uses it's own db.
Since they are both dealing with same products I want to shorten the time used in entering products data by syncing products tables in the 2 dbs so when I add a new product in the shop it shows in the POS.
I searched a lot but all results were talking about identical tables structure.
Unfortunately in my case the structure is different.
Shop products table is like this:
id name current_stock category_id brand_id
POS products table is like this:
id name code category_id brand_id
and another issue that the code column in the pos db should contain a unique number I use this command to generat it:
`code` = FLOOR(1000 + RAND() * 89999999)
I need it to be generated in the sync process.
I saw this and many other posts how to copy only distinct values from one table to another in Mysql? and it's about identical tables
Edit: At first I'll add all products but after that I'll need to add newer products only. This what I mean by syncing