How do I update my online mysql with my local mysql data

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
adsegzy
Forum Contributor
Posts: 184
Joined: Tue Jul 28, 2009 9:26 am

How do I update my online mysql with my local mysql data

Post by adsegzy »

Hello friends,
I have an online store where customers can make order and submit and get delivered at their doorstep. Also customers can purchase items offline at the store. Each offline sale is entered into the localhost mysql DB.

At the end of the each day's sales, every offline sales can just be uploaded to the online mysql DB with a click of a button.

Pls ow do I write this script.
Thanks
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: How do I update my online mysql with my local mysql data

Post by twinedev »

Well, it's not as simple as "make this script and run it, it will work". There are a ton of unknowns on this:

1. How is the data entered into the system at the actual store? Is it a copy of the same thing for the online store?

2. Even if it is the same, then you have to consider, how is the database structured? Are there autoincremented fields for tables (userid, cartid, orderid, paymentid), You have to make sure those don''t conflict.

3. How is data cross reference between the tables, I mean you may not be able to just change customerid because the site already uses that number, you then also need to make sure all copies of that are changed across all tables that used it.

4. What if use both your online store and the store front, how do you tie the account together?

Just too many variables here that are unknown to be able to say "this is how you do it", sorry. Plus, being that this will be something that deals with live order data for a business, I would say the best bet is to actually hire someone to produce this, where the will be able to test the thing with sample data (and preferably on a test copy of the site). Do you really want to try to hack something together now, and then find an issue with corrupt info later, then have to restore back to last nights backup (you are backing up nightly and keeping copies for a least a week right?)

Yeah, I'm mr "give bad news" today... ;-)
Post Reply