[maplab-users] logical querystring for numeric fields in
Yifter Kidane Fikru
fikru.yifter at unicatt.it
Wed Jul 21 06:56:58 EDT 2004
I have seen that many had problems in implementing a logical query string on numeric fields (on shape files, for example: select all regions with population greater than xxxxx, kind of query.) and I was experimenting hard on it. I find out the following works, which I hope will shade some light for many of you.
suppose that you want to provide a form where user selects a queryfield (query field, numeric), selects a queryoperator (0, <, >, etc) and input a value.
So putting the query string like this works fine (assuming that you know where to put this code):
$querystring = "("."[".$queryfield."]"."".$queryoperator."".$value.")";
$qLayer->queryByAttributes($queryfield, $querystring, MS_MULTIPLE);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 4490 bytes
Desc: not available
Url : http://lists.maptools.org/pipermail/maplab-users/attachments/20040721/de3efef2/attachment.bin
More information about the Maplab-users