MySQL Forums
Forum List  »  GIS

Re: Using MySQL Spatial Extensions to make a Google Maps interface.
Posted by: Daniel Paublini
Date: September 06, 2005 02:51PM

Hi there! I'm also working on a similar project, but I’m trying to use GMT (Generic Mapping Tools) for drawing the maps from my geographic data base. I started working on this before Google Maps appeared, and now I don't know which one will be better to use.
At this moment I’m stuck trying to fill my database with data gathered from a txt file, all this with php. The problem is that after inserting a point into the database and fetching the data with AsText() the field shows as NULL. Here is an example of how I’m doing it:

$punto = string;
require ($_SERVER['DOCUMENT_ROOT'] ."/config/db_config.php");
$conex = mysql_connect($host, $user, $password) or die ("Error al intentar conectar con la Base de Datos");
mysql_select_db ("prueba2");
$punto = "POINT(2 3)";
$pt = "INSERT INTO geom (pt) VALUES (GeomFromText('`".$punto."`'))";
$resultado = mysql_query($pt) or die (mysql_error());
echo "<br>"."Dato insertado";

Any comments about this will be very useful... Thanks!!!

Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.