Link to home
Start Free TrialLog in
Avatar of ioustinos_sarris
ioustinos_sarrisFlag for Greece

asked on

PhpMyAdmin Edit record that contains a polygon field

Hi there,
I have a table that one of its fields is a POLYGON

I manage to insert a polygon quite fine like this
INSERT INTO polygons_region VALUES ("test", GeomFromText('POLYGON((4.97141067864157 44.4269927920504,4.9602656138422 44.4171284166614,4.9562222293031 44.4171081193899,4.9524924246148 44.4160004581088,4.97141067864157 44.4269927920504))'));

Then if i go to phpmyadmin to edit this record i get this weird value for the polygon (i guess its an encpoded string) http://o7.no/uBHhxx

And then if i try to edit the name through the interface of phpmyadmin from test to test1 i get this error http://o7.no/vmemRO

Weird, any solutions? Is this something that phpmyadmin should fix? Should i report to them?
Avatar of honestman31
honestman31

can you please post your schema and what you expect to get for field POLYGON,
Thanks
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ioustinos_sarris

ASKER

CREATE TABLE IF NOT EXISTS `territories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `city_id` int(11) NOT NULL,
  `name` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `status_update` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `owner_id` int(11) NOT NULL COMMENT '0 for no owner',
  `bounds` polygon NOT NULL,
  `visits_foursquare` int(11) NOT NULL,
  `visits_fb` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=489 ;

I have entered the data in the database in that manner

INSERT INTO territories (`city_id`,`bounds`) VALUES (10,GeomFromText('POLYGON((38.15031715029785 38.140697756155376,23.762438984450498 38.140697756155376,23.762438984450498 23.750227585156292,38.15031715029785 23.750227585156292,38.15031715029785 38.140697756155376))'));
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yeah i know how to get the information in php.
The problem is that i need to be editing some of the entries via phpmyadmin and i cannot.
You're right, you can not.  You will have to get the information in PHP, edit it as text, and then update the row.