On Wed, Jun 17, 2009 at 04:13:35PM +0800, Tim Bowden wrote:
> my $sth = $dbh->prepare("INSERT INTO mygeom (description, mypoint)
> VALUES (?, ST_GeomFromText('POINT(? ?)', ?))");
> $sth->bind_param(1, $_);
> $sth->bind_param(2, $coord);
> $sth->bind_param(3, $coord);
The argument to ST_GeomFromText is a string. Naturally questionmarks
inside strings shouldn't be treated as placeholders.
Use "INSERT INTO mygeom (description, mypoint) VALUES (?, ST_GeomFromText(?,
?))"
and $sth->bind_param(2, "POINT($coord $coord)");
Tim.