My plan is to store data in my local MySQL database and after a time interval it will update my live MySQL database remotely. Is it possible?

I’m planing a inventory management script in PHP MySQL. The real problem is in our country net connection drops suddenly. So I want to first write to the local MySQL database and then it will update the real server. In any situation like internet connection dropped the script will work locally to gather data and retrieve data. When the internet connection comes ba