I'm trying to insert geographic coordinates of a polygon into my MySQL database. I have a field named polygon of type POLYGON, and I've tried running all of these queries but continue to get SQL syntax errors:
SET @g = 'POLYGON((-74.13591384887695 40.93750722242824,-74.13522720336914 40.929726129575016,-74.15102005004883 40.9329683629703,-74.14329528808594 40.94256444133327))';
INSERT INTO 'zones' ('polygon') VALUES (PolyFromText(@g));
INSERT INTO 'zones' ('polygon') VALUES (PolyFromText('POLYGON((-74.13591384887695 40.93750722242824,-74.13522720336914 40.929726129575016,-74.15102005004883 40.9329683629703,-74.14329528808594 40.94256444133327))'));
INSERT INTO 'zones' ('polygon') VALUES (PolyFromText('POLYGON((-74.13591384887695 40.93750722242824,-74.13522720336914 40.929726129575016,-74.15102005004883 40.9329683629703,-74.14329528808594 40.94256444133327))', 0));
The last query was generated using phpmyadmins own geo spatial tools and return "Column 'polygon' cannot be null". Any help is appreciated!