1
votes

I´ve found the google-tutorial for store locator: https://developers.google.com/maps/articles/phpsqlsearch_v3#findnearsql

The MySQL-table is done, it works on my server. I can write addresses and do correctly in phpmyadmin

SELECT id, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin( radians( lat ) ) ) ) AS distance FROM markers HAVING distance < 25 ORDER BY distance LIMIT 0 , 20;

But at the tutorial point "Outputting XML with PHP" I can´t go on.

I´ve created the file "phpsqlsearch_dbinfo.php", put my database details in and uploaded it. (all the things in "")

<? $username="username"; $password="password"; $database="username-databaseName"; ?>

Then I created "phpsqlsearch_genxml.php" as written, put the code from the tutorial in and uploaded it also. Which parts have I to change?

When I start the file in the browser there is the following message:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'dbo420324620@localhost' (Using password: YES) in /homepages/6/d11799920/htdocs/markisen/mx/2/phpsqlsearch_genxml.php on line 15
Not connected : Access denied for user: 'dbo420324620@localhost' (Using password: YES)

What have I done wrong?

2

2 Answers

0
votes

Either your username, password or database name is wrong.

The error message is deliberately vague in order that unauthorised system-crackers are not helped to find out what they need to change; although I guess you know your username and password.

It's possible the database name you need to use in your PHP code is not exactly the same as that shown in phpMyAdmin. Ask your hosting company what you should use in your include file.

0
votes

I had the same problem using a 1and1.com Managed Server. Tried everything.

localhost:/tmp/mysql5.sock and all combinations did not work.

Tried numerous other things and then discovered the solution.

Go to the PhpMyAdmin Control Panel. Select your database and click phpMyAdmin

You will then see your database tables and at the top you will see your database name dbXXXXXXXX preceded by some info like infoxyz1234:5678 This is the hosting server and port the server is using.

Use this instead of localhost:/tmp/mysql5.sock and mine worked like a charm.