pg_exec error

Randy James rjames57 at YAHOO.COM
Fri Jun 10 11:44:10 PDT 2005


Yes it it PHP and yes thats how i want it to look:

GeometryFromText('POINT(575618 5614867)',-1);

And ok i'll check out the '"

--- Ethan Alpert <ealpert at DIGITALGLOBE.COM> wrote:

> Sorry this is PHP right?
> 
> Read up on the differences between "'s and ''s.
> 
> You want the string you produce to look like:
> 
> GeometryFromText('POINT(<number> <number>)',<srid>);
> 
> In your case I don't think that's what you're getting you need to join
> the strings. PHP use . Doesn't it?
> 
> -e
> 
> -----Original Message-----
> From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
> Behalf Of Randy James
> Sent: Friday, June 10, 2005 11:33 AM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: [UMN_MAPSERVER-USERS] pg_exec error
> 
> 
> Hi
> I am having trouble with inserting a veriable with the GeometryFromText
> function, this the line that causes an error;
> 
> pg_exec($connection, "INSERT INTO sites VALUES
> ('$q_nxt_gid','$id','$label','$site_id','$comments',GeometryFromText('PO
> INT('$pointx'
> '$pointy')',-1)");
> 
> It produces this error, (Note; 575618 is the $pointx variable).
> 
> Warning: pg_exec(): Query failed: ERROR: syntax error at or near
> "575618" at character 88 in
> /var/www/html/gis/create/write_postgres.phtml on line 19
> 
> Thanks for any help i can get.
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the MapServer-users mailing list