<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>PHP MapScript queryByAttributes Issue</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=672374023-08012008><FONT face=Arial 
color=#0000ff size=2>Hi Ian,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=672374023-08012008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=672374023-08012008><FONT face=Arial 
color=#0000ff size=2>It's a long shot, but have you checked whether your 
attribute names (not&nbsp;just the values)&nbsp;are in upper/lowercase? Because 
attribute names are case sensitive.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=672374023-08012008><FONT face=Arial 
color=#0000ff size=2>What does your php log say? Because if you do a search, and 
it does not find matching values (as opposed to something else being wrong), it 
will report a warning in your php log. If this is what it says, then you will at 
least have narrowed it down. But it may give a different error. You must 
configure php to display warnings, though.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=672374023-08012008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=672374023-08012008><FONT face=Arial 
color=#0000ff size=2>regards,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=672374023-08012008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=672374023-08012008><FONT face=Arial 
color=#0000ff size=2>Jacob</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=672374023-08012008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=672374023-08012008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV><BR>
<BLOCKQUOTE 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> UMN MapServer Users List 
  [mailto:MAPSERVER-USERS@LISTS.UMN.EDU] <B>On Behalf Of </B>Ian 
  Tidy<BR><B>Sent:</B> 9 January 2008 08:11<BR><B>To:</B> 
  MAPSERVER-USERS@LISTS.UMN.EDU<BR><B>Subject:</B> [UMN_MAPSERVER-USERS] PHP 
  MapScript queryByAttributes Issue<BR></FONT><BR></DIV>
  <DIV></DIV><!-- Converted from text/rtf format -->
  <P><FONT face=Verdana size=2>Hi All,</FONT> </P>
  <P><FONT face=Verdana size=2>I am running MapServer 4.10 and am having a 
  problem with a query.</FONT> </P>
  <P><FONT face=Verdana size=2>My query code is:</FONT> 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Verdana 
  size=2>$qstring = "/^$street.*/";</FONT> 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Verdana 
  size=2>$oLayer = $map-&gt;getlayerbyname("smartworx");</FONT> 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Verdana 
  size=2>$oLayer-&gt;set("status", MS_ON);</FONT> 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Verdana 
  size=2>@$oLayer-&gt;queryByAttributes('STNAME', $qstring, MS_MULTIPLE);</FONT> 
  </P>
  <P><FONT face=Verdana size=2>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 face=Verdana 
  size=2>$qstring = "/^$street.*/";</FONT> 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Verdana 
  size=2>$oLayer = $map-&gt;getlayerbyname("crs_road_centreline");</FONT> 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Verdana 
  size=2>$oLayer-&gt;set("status", MS_ON);</FONT> 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Verdana 
  size=2>@$oLayer-&gt;queryByAttributes('ROAD_LABEL', $qstring, 
  MS_MULTIPLE);</FONT> </P>
  <P><FONT face=Verdana size=2>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 face=Verdana size=2>crs_road_centreline is the road centreline 
  network</FONT> <BR><FONT face=Verdana size=2>smartworx is a address point 
  file.</FONT> </P>
  <P><FONT face=Verdana size=2>Any Ideas???</FONT> </P>
  <P><SPAN lang=en-nz><FONT face=Verdana size=2>Cheers Ian</FONT></SPAN> 
  <BR><SPAN lang=en-nz><FONT face=Verdana 
  size=2>______________________<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 face=Georgia size=2>GIS 
  Analyst / Developer</FONT></B><BR><FONT face=Georgia size=2>Works Asset 
  Department</FONT><FONT face="Times New Roman"><BR></FONT><FONT face=Georgia 
  size=2>Napier City Council</FONT><FONT face="Times New Roman"><BR></FONT><FONT 
  face=Georgia size=2>Hastings St, Private Bag 6010, Napier, New 
  Zealand</FONT><FONT face="Times New Roman"><BR></FONT><B></B><B><FONT 
  face=Georgia size=2>Phone +64-6-835-7579 Ext. 8115</FONT></B><FONT 
  face="Times New Roman"><BR></FONT><FONT face=Georgia size=2>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 face=Georgia 
  color=#0000ff size=2>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 face=Georgia color=#0000ff 
  size=2>http://www.napier.govt.nz</FONT></U></SPAN></A><SPAN lang=en-nz><FONT 
  face=Georgia size=2> | </FONT></SPAN><A 
  href="http://maps.napier.govt.nz"><SPAN lang=en-nz><U><FONT face=Georgia 
  color=#0000ff size=2>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></BLOCKQUOTE></BODY></HTML>

<table><tr><td bgcolor=#ffffff><font color=#000000><pre>This email and any attachments are intended solely for the named recipient and are confidential. The copying or distribution of them or any information they contain by anyone other than the named recipient is prohibited. If you have received this document in error, please notify the sender and delete all copies from your computer system and destroy all hard copies. It is the recipient's responsibility to check this email and any attachments to this email for viruses before use.</pre></font></td></tr></table>