Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

GoogleMapsAPI 2.5 DB error not found problem

 
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
eatc7402
Smarty Rookie


Joined: 18 Feb 2008
Posts: 23

PostPosted: Wed Feb 20, 2008 9:57 pm    Post subject: GoogleMapsAPI 2.5 DB error not found problem Reply with quote

I am using php 4.3.1 on XP system. After install of
the 2.5 API, I loaded the sample code from the
README file, and created the GEOCODES table in my MYsql database. Running the sample code all I was
getting was a...

DB error: not found

I finally commented out the three addMarkerByAddress() lines so nothing would get
written to the database. Then at least I would get
a blank map printed. I thought I had a PEAR problem.
So I reloaded PEAR. Same error results.

I uploaded the API and the sample code to my
website, as they are running php 5.2 and their own
copy of Pear. I created the goecodes table on the
remote database. Ran the sample code, SAME error
on the different machine, differnet php and diff'
Pear. HMMMM.

I need some help debugging this one.
Hers the code..
Code:

<?php
    include("../../dbinfo_dbf.inc.php");
    require('GoogleMapAPI.class.php');

    $map = new GoogleMapAPI('map');
        // setup database for geocode caching
    $map->setDSN("mysql://$DBUser:$DBPass@$DBHost/$DBName");

    // enter YOUR Google Map Key
        $map->setAPIKey('myMapKEY');

    // create some map markers
    $map->addMarkerByAddress('621 N 48th St # 6 Lincoln NE 68502','PJ Pizza','<b>PJ Pizza</b>');
    $map->addMarkerByAddress('826 P St Lincoln NE 68502','Old Chicago','<b>Old Chicago</b>');
    $map->addMarkerByAddress('3457 Holdrege St Lincoln NE 68502',"Valentino's","<b>Valentino's</b>");

    ?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">


    <head>
    <?php $map->printHeaderJS(); ?>

    <?php $map->printMapJS(); ?>
    <!-- necessary for google maps polyline drawing in IE -->
    <style type="text/css">
      v\:* {
        behavior:url(#default#VML);
      }
    </style>
    </head>
    <body onload="onLoad()">

    <table border=1>
      <tr>
        <td>

          <?php $map->printMap(); ?>
        </td>

        <td>
          <?php $map->printSidebar(); ?>
        </td>
      </tr>
    </table>
    </body>
    </html>
?>


eatc7402[/code]
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP