Marino Fiorito wrote:
> Hi,
>  
> I'm trying a postgis layer in pmapper with administrative boundaries.
> The visualization of map it's ok but the query on the column of a layer 
> is not performed and the query returned the following php error:
>  
> [04-Oct-2006 10:40:15] PHP Warning:  pg_query() [<a 
> href='function.pg-query'>function.pg-query</a>]: Query failed: ERROR:  
> syntax error at or near &quot;USING&quot; at character 12 in 
> ..\apps\pmapper\incphp\query\squery.php on line 603
> [04-Oct-2006 10:40:15] P.MAPPER: PG Query error for : SELECT gid USING 
> SRID=26591,
>                          xmin(box3d(ogc_geom)),
>                          ymin(box3d(ogc_geom)),
>                          xmax(box3d(ogc_geom)),
>                          ymax(box3d(ogc_geom)),
>                          cod_prov,cod_com,nome_comune
>                     FROM comuni_5000
>                    WHERE  nome_comune ~* 'ROMA'
>                    LIMIT 301
> [04-Oct-2006 10:40:15] PHP Warning:  pg_numrows(): supplied argument is 
> not a valid PostgreSQL result resource in 
> ..\apps\pmapper\incphp\query\squery.php on line 607
>  
> inside the js_config.php the settings of Postgis layer are:
> searchList['comuni_5000'] = new Array('<?php echo _p("comune") ?>', 
> '#nome_comune', '<?php echo _p("nome comune") ?>','');
>  
> I think the problem is in the where condition:
>  WHERE  nome_comune ~* 'ROMA'

no, this is correct Postgres syntax for case insensitive regex queries. 
The error is in the 'SELECT gid USING ...' part where p.mapper does a 
wrong parsing of the layer's "DATA" tag in the map file.

>  
> why squery.php formatted the query like this?
>  
> have you got any idea about where is my mistake..?


I might get a better idea if you send me the layer definition in the map 
file.

armin



Reply via email to