<DIV>As usually: Thank you Rich</DIV>  <DIV>The strange part is that I have a match in my database, but I still get the NaN results. If I use the query tool from mapserver I get the proper results.<BR>The only difference is that when I send text (the qstring is a text) from the database to mapserver I get the proper results. When I send numbers (the qstring is a number) I get NaN results. Do you think it could be related to the type of the data used for query?</DIV>  <DIV>&nbsp;</DIV>  <DIV>I will make other tests</DIV>  <DIV>&nbsp;</DIV>  <DIV>William</DIV>  <DIV>&nbsp;</DIV>  <DIV><BR><B><I>Richard Greenwood &lt;richard.greenwood@gmail.com&gt;</I></B> wrote:</DIV>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">On 3/20/07, william paul <WILLIAMPAUL28@YAHOO.COM>wrote:<BR>&gt; Hi:<BR>&gt;<BR>&gt; I am using Dbox and the example provided by Rich Greenwood, to map the<BR>&gt; results from a database query. I have modified
 the script so you can change<BR>&gt; the queryfile, qitem and qstring. The script works OK on 1 layer, but for<BR>&gt; others I get NaN. Before to map the results I test ( alert(qlayer, qitem,<BR>&gt; qstring)) to see if the queryfile, qitem and qstring are correct. Even<BR>&gt; though I have the core ct names for each one I still get NaN results<BR>&gt; What could be the problem?<BR>&gt;<BR>&gt; script from the database query results<BR>&gt;  <SCRIPT language=javascript type=text/javascript><br>> var qlayer = "anyQlayer";<br>> var qitem = "anyQitem";<br>> function map(qstring)<br>> {<br>> opener.itemQueryModified(qstring, qitem, qlayer);<br>> window.close();<br>> opener.focus();<br>> }<br>> </SCRIPT>   <BR>&gt;<BR>&gt;<BR>&gt; modified itemQuery script<BR>&gt; ms.itemqueryoptions = "&amp;mapext=shapes&amp;savequery=true&amp;";<BR>&gt; function itemQueryModified(qstring, qitem, qlayer)<BR>&gt; {<BR>&gt; //ms.setLayer(qlayer, true);<BR>&gt; var uri = ms.mapserver + '?map='
 + ms.mapfile + "&amp;layers=" +<BR>&gt; ms.getLayers("+") + "&amp;mapsize=" + ms.width + "+" + ms.height;<BR>&gt; uri += ms.itemqueryoptions;<BR>&gt; uri += '&amp;mode=itemquery'<BR>&gt; uri += '&amp;qlayer=' + qlayer;<BR>&gt; uri += '&amp;qitem=' + qitem;<BR>&gt; uri += '&amp;qstring=' + qstring;<BR>&gt; var response = get_content(uri);<BR>&gt; var tokens = response.split(',');<BR>&gt; alert(qstring + qitem + qlayer + ", " + Number(tokens[1]),<BR>&gt; Number(tokens[2]), Number(tokens[3]), Number(tokens[4]));<BR>&gt; ms.setExtent(Number(tokens[1]), Number(tokens[2]), Number(tokens[3]),<BR>&gt; Number(tokens[4]));<BR>&gt; main.setImage(tokens[5]);<BR>&gt; ms.savedqueryfile=tokens[6];<BR>&gt; domouseclick('pan');<BR>&gt; }<BR><BR>You probably didn't get a match in your database. NaN means "Not a<BR>Number". MapServer did not return an extent for the selection because<BR>it could not find anything, and so your browser was not able to<BR>convert the tokens 1-4 into
 numbers.<BR><BR>I try to catch that and tell the user something like "no results found".<BR><BR>Rich<BR><BR>-- <BR>Richard Greenwood<BR>richard.greenwood@gmail.com<BR>www.greenwoodmap.com<BR></BLOCKQUOTE><BR><p>&#32;

<hr size=1>It's here! Your new message!<br>Get
<a href="http://us.rd.yahoo.com/evt=49938/*http://tools.search.yahoo.com/toolbar/features/mail/"> new email alerts</a> with the free <a href="
http://us.rd.yahoo.com/evt=49938/*http://tools.search.yahoo.com/toolbar/features/mail/">Yahoo! Toolbar.</a>