[Good Grief ]
      Thanks for the answer, but if  GDownload
("phpsqlajax_genxml3.php", function(data) { ... } does not suuply a ?
id argument or something like this, I can not send this argument to
function GDownloadUrl at all ?
On the website----http://floridalandwww.com/gallery_mysqli08.php---if
you click on the second location button there is no marker,but the 1st
button shows the address,and we are trying to click only one button to
show each location of each house.
Thanks,
Elena Andrew.
________________________________________________________________________
Anyway, your php and SQL seems right. Different ?id= arguments return
different data. So something must be wrong with the way you are
fetching or using that data.

Your page http://floridalandwww.com/phpsqlajax_map.htm does this:
GDownloadUrl("phpsqlajax_genxml3.php", function(data) { ... }
that is, it doesn't supply a ?id argument at all.

The response which your function tries to use is
Invalid query: You have an error in your SQL syntax; check the manual
that corresponds to your MySQL
 server version for the right syntax to use near '' at line 1
which doesn't do much.


Andrew Leach
_____________________________________________________________________
http://floridalandwww.com/phpsqlajax_genxml3.php?id=1


     I have problem when I try to pull up one location---- longitudes
and latitudes are in my database.
When I use querry like below everything works fine.
#1. //$query ="SELECT `image_id`, `address`, `lat`, `lng` ,`type` FROM
`images` WHERE 'image_id' = 1";
But when I replace query with--->$query ="SELECT `image_id`,
`address`, `lat`, `lng`, `type` FROM `images` WHERE image_id = $iid";
then the code phpsqlajax_genxml3.php generates the same xml,but my
next step(http://floridalandwww.com/phpsqlajax_map.htm) does not show
me the single marker on the map.
  While I use querry#1 where image id=1-----everything works fine and
it shows me the right coordinates for the marker.
but whatever query I use code(http://floridalandwww.com/
phpsqlajax_genxml3.php?id=1)echos(displays) the same xml file.
code phpsqlajax_genxml3.php is below:

<?php
require("phpsqlajax_dbinfo.php");
// Start XML file, create parent node
$iid = $_GET['id'];
//echo $iid;
$dom = new DOMDocument("1.0");
$node = $dom->createElement("markers");
$parnode = $dom->appendChild($node);
// Opens a connection to a MySQL server
$connection=mysql_connect ("xxxsecurityxxx", $username, $password);
if (!$connection) {  die('Not connected : ' . mysql_error());}
// Set the active MySQL database
$db_selected = mysql_select_db($database, $connection);
if (!$db_selected) {
  die ('Can\'t use db : ' . mysql_error());
}
// Select all the rows in the markers table

//$query ="SELECT `image_id`, `address`, `lat`, `lng` ,`type` FROM
`images`";
$query ="SELECT `image_id`, `address`, `lat`, `lng`, `type` FROM
`images` WHERE image_id = $iid";
$result = mysql_query($query);
if (!$result) {
  die('Invalid query: ' . mysql_error());
}
header("Content-type: text/xml");
// Iterate through the rows, adding XML nodes for each
while ($row = @mysql_fetch_assoc($result)){

  // ADD TO XML DOCUMENT NODE
  $node = $dom->createElement("marker");
  $newnode = $parnode->appendChild($node);
  $newnode->setAttribute("name",$row['name']);
  $newnode->setAttribute("address", $row['address']);
  $newnode->setAttribute("lat", $row['lat']);
  $newnode->setAttribute("lng", $row['lng']);
  $newnode->setAttribute("type", $row['type']);
}
echo $dom->saveXML();
?>
Thanks for any suggestions.----Lena Andrew

____________________________________________________________
-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.


Reply via email to