<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>PHP MapScript queryByAttributes Issue</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Verdana">Hi All,</FONT>
</P>

<P><FONT SIZE=2 FACE="Verdana">I am running MapServer 4.10 and am having a problem with a query.</FONT>
</P>

<P><FONT SIZE=2 FACE="Verdana">My query code is:</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Verdana">$qstring = &quot;/^$street.*/&quot;;</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Verdana">$oLayer = $map-&gt;getlayerbyname(&quot;smartworx&quot;);</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Verdana">$oLayer-&gt;set(&quot;status&quot;, MS_ON);</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Verdana">@$oLayer-&gt;queryByAttributes('STNAME', $qstring, MS_MULTIPLE);</FONT>
</P>

<P><FONT SIZE=2 FACE="Verdana">And this fails, but when I run the same code using a different table it works:</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Verdana">$qstring = &quot;/^$street.*/&quot;;</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Verdana">$oLayer = $map-&gt;getlayerbyname(&quot;crs_road_centreline&quot;);</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Verdana">$oLayer-&gt;set(&quot;status&quot;, MS_ON);</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Verdana">@$oLayer-&gt;queryByAttributes('ROAD_LABEL', $qstring, MS_MULTIPLE);</FONT>
</P>

<P><FONT SIZE=2 FACE="Verdana">Now I know the obvious answer is that the item I am searching for doesn't exist in my table, but I have checked and it does exist.&nbsp; The only difference between the two (2) shape files is that crs_road_centreline is a LINE table and smartworx is a POINT table and have slightly different structures.</FONT></P>

<P><FONT SIZE=2 FACE="Verdana">crs_road_centreline is the road centreline network</FONT>

<BR><FONT SIZE=2 FACE="Verdana">smartworx is a address point file.</FONT>
</P>

<P><FONT SIZE=2 FACE="Verdana">Any Ideas???</FONT>
</P>

<P><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Verdana">Cheers Ian</FONT></SPAN>

<BR><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Verdana">______________________<BR>
<B></B></FONT><B></B><B><FONT FACE="Georgia">Ian Tidy</FONT></B><FONT FACE="Times New Roman"><BR>
</FONT><B></B><B><FONT SIZE=2 FACE="Georgia">GIS Analyst / Developer</FONT></B><BR>
<FONT SIZE=2 FACE="Georgia">Works Asset Department</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Georgia">Napier City Council</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Georgia">Hastings St, Private Bag 6010, Napier, New Zealand</FONT><FONT FACE="Times New Roman"><BR>
</FONT><B></B><B><FONT SIZE=2 FACE="Georgia">Phone +64-6-835-7579 Ext. 8115</FONT></B><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Georgia">Fax +64-6-834-4195</FONT><FONT FACE="Times New Roman"><BR>
</FONT></SPAN><A HREF="mailto:iant@napier.govt.nz"><SPAN LANG="en-nz"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Georgia">mailto:iant@napier.govt.nz</FONT></U></SPAN></A><SPAN LANG="en-nz"><BR>
</SPAN><A HREF="http://www.napier.govt.nz"><SPAN LANG="en-nz"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Georgia">http://www.napier.govt.nz</FONT></U></SPAN></A><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Georgia"> | </FONT></SPAN><A HREF="http://maps.napier.govt.nz"><SPAN LANG="en-nz"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Georgia">http://maps.napier.govt.nz</FONT></U></SPAN></A><SPAN LANG="en-nz"><FONT FACE="Times New Roman"> </FONT></SPAN>
</P>
<BR>
<BR>


<HR>
This e-mail message has been scanned for Viruses and Content and cleared by 
<FONT color=#400080><STRONG>MailMarshal </STRONG></FONT>
<HR>

<FONT 
size=1>######################################################################<BR>Attention: 
<BR>This e-mail message and accompanying data may contain information that<BR>is 
confidential and subject to legal privilege. Any information<BR>provided is 
given in good faith. However unless specifically stated to<BR>the contrary, 
Napier City Council accepts no liability for the<BR>content of this e-mail or 
for the consequences of any action taken on<BR>the basis of the information 
provided, unless that information is<BR>subsequently confirmed in writing. If 
you are not the intended recipient,<BR>you are notified that any use, 
dissemination, distribution or copying<BR>of this message or data is prohibited. 
If you received this e-mail<BR>message in error, please notify us immediately 
and erase all copies<BR>of this message and attachments. Thank you. 
</FONT>
</BODY>
</HTML>