Tutorial: How to Display Google Map with MySQL Database using PHP
About Display Google Map with MySQL Database using PHP Tutorial
The map in this tutorial displays two kinds of markers to differentiate between the location of restaurants and bars respectively. A database in MySQL stores information about the individual marker locations like the type of place (whether it’s a restaurant or a bar), its name, address and geographic coordinates. The map retrieves this information from the database, through an XML file that acts as an intermediary between the database and the map. You can use PHP statements to export marker information from the database to an XML file.
The mark icon here is the starting point where it is the first row in the table and the flag icon is the ending point.
Thus, I am using google map to create a dynamic google map that take locations such as longitude and latitude stored in the database using PHP and MySQL and display the selected locations by markers on the map.
How To Run??
Above all, to run this project you must have installed a virtual server i.e XAMPP on your PC. This tutorial with source code is free to download, Use for educational purposes only!
Follow the following steps after Starting Apache and MySQL in XAMPP:
1st Step: Firstly, Extract the file
2nd Step: After that, Copy the main project folder
3rd Step: So, you need to Paste in xampp/htdocs/
Further, Now Connecting Database
4th Step: So, for now, Open a browser and go to URL “http://localhost/phpmyadmin/”
5th Step: After that, Click on the databases tab
6th Step: So, Create a database naming “location_db” and then click on the import tab
7th Step: Certainly, Click on browse file and select “location_db.sql” file which is inside the “db” folder
8th Step: Meanwhile, click on Go button.
After Creating Database,
9th Step: Moreover, Open a browser and go to URL “http://localhost/map”
For instance, have a look at the video below for the project demo.Download Here