Ok, a kinda newbie question.  I set up a Postgres DB with a table that had a
Point and a Polygon in it (to hold XY and shape settings for munging a jpeg
image in php).

I could not easily figure out how to extract the data into a reasonably easy
to use format in PHP.  The best I could do  seemed like it was extracted
into a string, and then I had to parse that.
While this works, it seems like a BIG hack to me, and the docs have been
less then forthcoming.
I've also tried the usual google search of "php postgres polygon" to see if
I could get an idea.

For example, I stored the Point as:    (432, 120)
And I got "(432, 120)" as a string, and had to parse it:

  $Q = "SELECT * FROM room WHERE id=$id";

  if(!($Result = pg_exec($Connection, $Q)))
    print("Query failed $Q");

  $myroom = pg_fetch_array($Result, $i);
  $xy = $myroom["xy"];
  $xyar = split("[\(,\)]", $xy);
  $x = $xyar[1];
  $y = $xyar[2];

Any ideas?

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to