Posts

Showing posts from May, 2021

Automatically backup MySQL database with Batch file on Windows

Image
Data backup is always very important in the way each system operates. In Linux you can easily automatically install the Crontab command, so what about Windows? We need to write code in Batch file and setup Task Schedule in Windows operating system. Very simple and fast. Task Schedule is available in Windows operating system. You need to turn it on and map it to a Batch file. Our problem is running on Windows, maybe Windows 7, 10, Windows server and backing up data from MySQL. The need to prepare: 1. Assuming we are using Xampp, you need to find the path of the mysqldump file 2. Prepare information about database: User, Password, Database Name 3. Prepare a database storage path. Database in this article will be saved as folder name of database, which will contain file mysql with format Year-month-date.sql Doing: 1. Open the task schedule by either search command or in the Control panel. 2. Create Basic Task 3. Type name of task 4. Select auto-run time: daily, weekly, monthly, … 5. By d...

Getting Latitude and Longitude from a Click Event

Image
When we get the coordinates of a location in the world, we can get a lot of information about it. These include weather information, traffic, economic information, pricing, … The use of google maps makes it easy to get the coordinates of the place we select by clicking the mouse. You need regist Google Maps API key to use and show maps. The default when opening the maps is the location of Tokyo Japan, the zoom level is 6, of course you can choose another location, the other zoom level depends on the requirements.     1. HTML: Show maps in tags html <p id=”getLatLng”></p> <div id=”map”></div>   2. CSS: Show maps with css <style> /* Always set the map height explicitly to define the size of the div * element that contains the map. */ #map { height: 100%; } /* Optional: Makes the sample page fill the window. */ html, body { height: 100%; margin: 0; padding: 0; } </style>   3. API KEY You need resigster one API KEY to show map ...