I'm develop a web application where in warehouse work on localhost projects(web application) and here internet is not stable. so i want that if internet connection is available then localhost mysqldata is transfer in domain mysql database in a fix time interval. I'm using cron function but it's not working. plz tell me how can transfer the data local to domain database in a time interval.................... plz help me..............
dyou mean for the local network to view/share or simply to deploy the app online? if its the later, you could just import the database to your host server. assuming you already have a domain and a host.. inside the phpmyadmin, you can import your database.
thanks for reply... but i don't want import every hour the database. i want a script where every hour localhost data transfer to domain database... because it's a routin work. and no body spend the time every hour
once its imported, they can use it there an that it will be updated every now and then so no importing is going to happen every hour.
i think they are looking for a cron job to make a local copy of the mysql server... not sure if they want to send it to the internet, or get it from the internet though
I did something like this long time ago for a site of mine. I made a php script which checked the database on specified time interval . The records that were created or modified during that hour were stored in a file like regular mysql queries. ex: insert into table (all values here); insert into table (all values here); and so on. when this file was complete, the php script would upload this file to the server using ftp. A cron job on the server would pass this file to the mysql using shell. I don't know if you have access to shell or not. If not, then you can use your localhost php script to connect to your mysql server on your webhost and run the query like regular php scripts do. It'll take longer, and you'll have to handle multiple connections.
Well it might be possible but it is little tricky. I will explain you in steps. 1) Insert two fields in the table created_at, updated_at and set their data type as timestamp. Update these fields when you insert/update data. 2) Enable CURL on your localhost and use this code. http://www.techsirius.com/2012/11/get-page-data-through-curl.html 3) Setup CRON like system on your localhost using this link http://stackoverflow.com/questions/24035090/run-cron-job-on-php-script-on-localhost-in-windows 4) Create a script for localhost that check every table in DB one by one if is there any new data row(updated_at, created_at). If yes fetch all rows and send them to server using CURL(Step 2) 5) Create a script for server that receive data from localhost and insert/update data into database. Once localhost cron trigger the script DB synchronization will start working. I hope this would help you. If you have any question please let me know.
Are you trying to pull the domain MySQL DB to your local computer with cron, or the other way around?