Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't I insert into MySQL?

Tags:

+---------+---------+------+-----+---------+----------------+
| Field   | Type    | Null | Key | Default | Extra          |
+---------+---------+------+-----+---------+----------------+
| id      | int(11) | NO   | PRI | NULL    | auto_increment |
| user_id | int(11) | NO   | UNI | NULL    |                |
| utm     | point   | NO   | MUL | NULL    |                |
+---------+---------+------+-----+---------+----------------+

insert into life(user_id, utm)  values(99,point(4,4));

ERROR 1416 (22003): Cannot get geometry object from data you send to the GEOMETRY field
like image 839
TIMEX Avatar asked Feb 15 '10 15:02

TIMEX


1 Answers

Have you tried:

insert into life(user_id, utm)  values(99,PointFromWKB(POINT(4,4)));
like image 176
f3lix Avatar answered Oct 03 '22 18:10

f3lix