I'm using prepared statements to insert data into my database, problem is I'm not able to use
INSERT INTO table (polygon) VALUES (GeomFromText(POLYGON((?,?,?,?,?,?))))
why? well, seems the GeomFromText itself is interpreted as text :/ so I figured I'd try pushing pure WKB strings into the db instead, problem is I can't really figure out how to pack a WKT into WKB.
Could someone help me do this with this format description: http://dev.mysql.com/doc/refman/5.0/en/gis-wkb-format.html and the doc for pack() over at: http://php.net/manual/en/function.pack.php