0

I am trying to learn how to export from an Xampp phpmyadmin sql database to a google API to create markers.

I am trying to follow this guide:

https://developers.google.com/maps/solutions/store-locator/clothing-store-locator?csw=1

I get to the "Checking that XML output works" section. I try to run my script by typing into my browser: http://localhost/projectgmaps/storelocator.php

This kicks out a page with: *

Notice: Undefined index: lat in C:\xampp\htdocs\projectgmaps\storelocator.php on line 4 Notice: Undefined index: lng in C:\xampp\htdocs\projectgmaps\storelocator.php on line 5 Notice: Undefined index: radius in C:\xampp\htdocs\projectgmaps\storelocator.php on line 6 Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\projectgmaps\storelocator.php:12 Stack trace: #0 {main} thrown in C:\xampp\htdocs\projectgmaps\storelocator.php on line 12

* This is line 4,5,6:

$center_lat = $_GET["lat"];
$center_lng = $_GET["lng"];
$radius = $_GET["radius"];

and this is line 12:

$connection=mysql_connect (localhost, $username, $password);

Is anyone able to tell me what is wrong here?

Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119
Paige
  • 7
  • 3
  • 1
    PHPMyAdmin *is not* a database. It is a web interface for your MySQL database. – Jay Blanchard Mar 20 '18 at 12:14
  • 1
    Take a book or an online course, or something that will teach you the basics of the programming language. Then try to build something using a 3rd party service. You don't know what array is, what GET parameters are, what undefined function is and so on. – vuryss Mar 20 '18 at 12:16
  • ***Please [stop using `mysql_*` functions](http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php).*** [These extensions](http://php.net/manual/en/migration70.removed-exts-sapis.php) have been removed in PHP 7. Learn about [prepared](http://en.wikipedia.org/wiki/Prepared_statement) statements for [PDO](http://php.net/manual/en/pdo.prepared-statements.php) and [MySQLi](http://php.net/manual/en/mysqli.quickstart.prepared-statements.php) and consider using PDO, [it's really pretty easy](http://jayblanchard.net/demystifying_php_pdo.html). – Jay Blanchard Mar 20 '18 at 12:18

0 Answers0