<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<STYLE type=text/css>DIV {
        MARGIN: 0px
}
</STYLE>
<META name=GENERATOR content="MSHTML 8.00.6001.18939"></HEAD>
<BODY>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=835005214-20082010>I
tried it so here is the file. I tweaked it a bit removed
extra dollar sign, curly bracket, and double quotes but still not
working. I will continue to look at it.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=835005214-20082010></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=835005214-20082010>jim</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=835005214-20082010></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=835005214-20082010><html><BR><head><BR></head><BR><?php<BR>$field=(isset($_REQUEST['field']))?$_REQUEST['field']:"none";<BR>$field2=(isset($_REQUEST['field2']))?$_REQUEST['field2']:"none";<BR>$sort=(isset($_REQUEST['sort']))?$_REQUEST['sort']:"Surveyor_Image_Link.TRS";<BR>//$sort2=(isset($_REQUEST['sort2']))?$_REQUEST['sort2']:"Surveyor_Image_Link.DOCTYPE";<BR>$searchval=(isset($_REQUEST['searchval']))?$_REQUEST['searchval']:"none";<BR>$searchval2=(isset($_REQUEST['searchval2']))?$_REQUEST['searchval2']:"none";</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=835005214-20082010>if
($field <> "none") {<BR> // Microsoft Access connection
string.<BR> // Douglas server<BR> //$db =
'\\ms4w\\apps\\GeoMOOSE\\douglas\\maps_douglas\\database\\parcels.mdb';<BR> //
HEI server<BR> $db =
'\\ms4w\\apps\\GeoMOOSE\\douglas\\maps_douglas\\database\\aex.mdb';</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=835005214-20082010> $conn = new COM('ADODB.Connection'); // or
exit('Cannot start ADO.');</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=835005214-20082010> // Two ways to connect. Choose
one.<BR> $conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=$db"); // or exit('Cannot open with
Jet.');<BR> //$conn->Open("DRIVER={Microsoft Access Driver
(*.mdb)}; DBQ=$db"); // or exit('Cannot open with driver.');</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=835005214-20082010> // SQL statement to build
recordset.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=835005214-20082010>$clauses = array();<BR>if($field == "TRS")
{<BR> array_push($clauses, "TRS like
'%".$searchval$."%'");<BR>}<BR>if($field2 == "DOCTYPE")
{<BR> array_push($clauses, "DOCTYPE LIKE
'".$searchval2."%'");<BR>}<BR>$all_clauses = implode(" or ",
$clauses);</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=835005214-20082010> $rs = $conn->Execute("SELECT * FROM
Surveyor_Image_Link WHERE ".$all_clauses." ORDER BY ".$sort." ASC");</DIV>
<DIV> } else {<BR> echo "You have reached this page
by mistake.";<BR> }</DIV>
<DIV><BR>}<BR>?><BR><body></DIV>
<DIV> </DIV>
<DIV><b>Search Results:</b><BR>
<?php<BR> // Display all the values in the
records set<BR> if ($field <> "none")
{<BR> if ($rs->EOF)
{<BR> echo
"<br><b>Search Found No
Records!</b><br>";<BR> }
else {<BR> echo "<table border='0'
width='250' class='message'>";<BR> while
(!$rs->EOF) {<BR> $fv1 =
$rs->Fields("TRS");<BR> $fv2 =
$rs->Fields("SECTION");<BR> $fv3
=
$rs->Fields("TOWNSHIP");<BR> $fv4
=
$rs->Fields("RANGE");<BR> $fv5
=
$rs->Fields("LOCATION");<BR> $fv6
=
$rs->Fields("DOCTYPE");<BR> $fv7
=
$rs->Fields("DOCUMENTID");<BR> $fv8
=
$rs->Fields("CREATOR");<BR> $fv9
=
$rs->Fields("DATE");<BR> $fv10
=
$rs->Fields("DESCRIPTION");<BR> $fv11
=
$rs->Fields("NUMOBJECTS");<BR> $fv12
=
$rs->Fields("PAGENUM");<BR> $fv13
=
$rs->Fields("QUICKLINK");<BR> $fv14
=
$rs->Fields("OBJECTID");<BR> $fv15
=
$rs->Fields("TRS_ORIG");<BR> echo
"<tr>";<BR>// echo
'<td>TRS#: <a
href=\'../survey_section_mi_parcelform.php?str='.$fv1->value.'\'
title=\'Click to View Survey Info\'
target=\'_blank\'>'.$fv1->value.'</a>&nbsp;';</DIV>
<DIV> </DIV>
<DIV> echo '<td>TRS#: <a
href=\'../pdf/'.$fv13->value.'\' title=\'Click to View Survey Scanned Image\'
target=\'_blank\'>'.$fv1->value.'</a>&nbsp;';</DIV>
<DIV> </DIV>
<DIV> echo '<a
href=\'javascript:getMapbook("php/zoomto.php?map=/ms4w/apps/GeoMOOSE/douglas/maps_douglas/sections/itemquery_sections.map&mode=xml&highlight=true&buffer=500&qitem=STRING&qstring='.$fv15->value.'",
Events, Map, true)\'><img src=\'shared/images/view.png\' border=\'0\'
title=\'Click to Zoom Map to
Parcel\'></a><br>';<BR> echo
"Section: ".$fv2->value."<br>";<BR>
echo "Township:
".$fv3->value."<br>";<BR>
echo "Range:
".$fv4->value."<br>";<BR>
echo "Location:
".$fv5->value."<br>";<BR> echo
"Document Type:
".$fv6->value."<br>";<BR> echo
"Document ID: ".$fv7->value."<br>";<BR>
echo "Creator:
".$fv8->value."<br>";<BR>
echo "Date:
".$fv9->value."<br>";<BR>
echo "Description:
".$fv10->value."<br>";<BR>
echo "Number of Pages:
".$fv11->value."<br>";<BR>
echo "Page Number:
".$fv12->value."<br>";<BR>
echo "Object ID:
".$fv14->value."<br>";<BR> //echo
"<td><a href=\"javascript:alert(Function not implemented: PIN
".$fv1->value.")'><img src='icons/zoomtofeature.png' border='0'
title='Click to Zoom Map to
Parcel'></a></td>";<BR> echo
"</tr>";<BR> echo
"<tr><td><hr></td></tr>";<BR> $rs->MoveNext();<BR> }<BR> echo
"</table>";<BR> }<BR> }<BR> ?></DIV>
<DIV> </DIV>
<DIV></body><BR><?php<BR>if ($field <> "none")
{<BR> $rs->Close();<BR> $conn->Close();<BR> $rs =
null;<BR>$conn = null;<BR>} //end if
statment<BR>?><BR></html></SPAN></FONT></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left><FONT size=2
face=Tahoma>-----Original Message-----<BR><B>From:</B> Dan Little
[mailto:danlittle@yahoo.com] <BR><B>Sent:</B> Thursday, August 19, 2010 5:54
PM<BR><B>To:</B> Jim Dahl;
geomoose-users@lists.sourceforge.net<BR><B>Subject:</B> Re: [Geomoose-users]
Need help with ELSE / OR statements<BR><BR></FONT></DIV>
<DIV style="FONT-FAMILY: arial, helvetica, sans-serif; FONT-SIZE: 10pt">
<DIV>Is this the old version of the script? It looks like it does not include
the code suggestion I made.</DIV>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(16,16,255) 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px">
<DIV style="FONT-FAMILY: arial, helvetica, sans-serif; FONT-SIZE: 10pt"><BR>
<DIV
style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><FONT
size=2 face=Tahoma><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Jim
Dahl <jim.dahl@mail.co.douglas.mn.us><BR><B><SPAN
style="FONT-WEIGHT: bold">To:</SPAN></B> Dan Little
<danlittle@yahoo.com>;
geomoose-users@lists.sourceforge.net<BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> Thu, August 19, 2010 3:02:23
PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE:
[Geomoose-users] Need help with ELSE / OR statements<BR></FONT><BR>
<STYLE type=text/css>DIV {
        MARGIN: 0px
}
</STYLE>
<DIV><SPAN class=734050120-19082010><FONT color=#0000ff size=2
face=Arial>Dan, it must be getting close. I had to take out a curly
bracket } and a dollar sign $ to make it not error out but search came
back empty. I will include more script if that
helps.</FONT></SPAN></DIV>
<DIV><SPAN class=734050120-19082010><FONT color=#0000ff size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=734050120-19082010><FONT color=#0000ff size=2
face=Arial><?php<BR>$field=(isset($_REQUEST['field']))?$_REQUEST['field']:"none";<BR>$field2=(isset($_REQUEST['field2']))?$_REQUEST['field2']:"none";<BR>$sort=(isset($_REQUEST['sort']))?$_REQUEST['sort']:"Surveyor_Image_Link.TRS";<BR>//$sort2=(isset($_REQUEST['sort2']))?$_REQUEST['sort2']:"Surveyor_Image_Link.DOCTYPE";<BR>$searchval=(isset($_REQUEST['searchval']))?$_REQUEST['searchval']:"none";<BR>$searchval2=(isset($_REQUEST['searchval2']))?$_REQUEST['searchval2']:"none";</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=734050120-19082010><FONT color=#0000ff size=2 face=Arial>if
($field <> "none") {<BR> // Microsoft Access connection
string.<BR> // Douglas server<BR> //$db =
'\\ms4w\\apps\\GeoMOOSE\\douglas\\maps_douglas\\database\\parcels.mdb';<BR> //
HEI server<BR> $db =
'\\ms4w\\apps\\GeoMOOSE\\douglas\\maps_douglas\\database\\aex.mdb';</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=734050120-19082010><FONT color=#0000ff size=2
face=Arial> $conn = new COM('ADODB.Connection'); // or
exit('Cannot start ADO.');</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=734050120-19082010><FONT color=#0000ff size=2
face=Arial> // Two ways to connect. Choose
one.<BR> $conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=$db"); // or exit('Cannot open with
Jet.');<BR> //$conn->Open("DRIVER={Microsoft Access Driver
(*.mdb)}; DBQ=$db"); // or exit('Cannot open with
driver.');</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=734050120-19082010><FONT color=#0000ff size=2
face=Arial> // SQL statement to build
recordset.<BR> if ($field == "TRS" || $field2 == "DOCTYPE")
{<BR> $rs = $conn->Execute("SELECT * FROM
Surveyor_Image_Link WHERE TRS LIKE '%".$searchval."%' ORDER BY ".$sort."
ASC");<BR>// ||<BR>// ) elseif ($field2 ==
"DOCTYPE") {<BR>// $rs = $conn->Execute("SELECT * FROM
Surveyor_Image_Link WHERE DOCTYPE LIKE '".$searchval2."%' ORDER BY ".$sort."
ASC");<BR> } else {<BR> echo "You have reached
this page by mistake.";<BR> }</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=734050120-19082010><FONT color=#0000ff size=2
face=Arial><BR>}<BR>?></FONT></SPAN></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left><FONT size=2
face=Tahoma>-----Original Message-----<BR><B>From:</B> Dan Little
[mailto:danlittle@yahoo.com] <BR><B>Sent:</B> Thursday, August 19, 2010
1:05 PM<BR><B>To:</B> Jim Dahl;
geomoose-users@lists.sourceforge.net<BR><B>Subject:</B> Re:
[Geomoose-users] Need help with ELSE / OR statements<BR><BR></FONT></DIV>
<DIV style="FONT-FAMILY: arial, helvetica, sans-serif; FONT-SIZE: 10pt">
<DIV>Good news, GM2.2 can do this! :) Bad news... GM1.6 is harder and you
need to use manual SQL.</DIV>
<DIV><BR></DIV>
<DIV>$clauses = array();</DIV>
<DIV>if($field == "TRS") {</DIV>
<DIV> array_push($clauses, "TRS like '%".$searchval$."%'");</DIV>
<DIV>}</DIV>
<DIV>if($field2 == "DOCTYPE") {</DIV>
<DIV> array_push($clauses, "<SPAN
style="FONT-FAMILY: Arial; FONT-SIZE: small"
class=Apple-style-span>DOCTYPE LIKE '".$searchval2."%'");</SPAN></DIV>
<DIV><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: small"
class=Apple-style-span>}</SPAN></DIV>
<DIV><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: small"
class=Apple-style-span>$all_clauses = implode(" or ",
$clauses);</SPAN></DIV>
<DIV><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: small"
class=Apple-style-span><BR></SPAN></DIV>
<DIV><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: small"
class=Apple-style-span> $rs = $conn->Execute("SELECT * FROM
Surveyor_Image_Link WHERE ".$all_clauses." ORDER BY ".$sort."
ASC");</SPAN></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(16,16,255) 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px">
<DIV
style="FONT-FAMILY: arial, helvetica, sans-serif; FONT-SIZE: 10pt"><BR>
<DIV
style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><FONT
size=2 face=Tahoma><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B>
Jim Dahl <jim.dahl@mail.co.douglas.mn.us><BR><B><SPAN
style="FONT-WEIGHT: bold">To:</SPAN></B>
geomoose-users@lists.sourceforge.net<BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> Thu, August 19, 2010 9:56:08
AM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B>
[Geomoose-users] Need help with ELSE / OR statements<BR></FONT><BR>
<DIV><FONT size=2 face=Arial><SPAN class=463185014-19082010>I am trying
to add two search fields in my GM app. I can make each field
search correctly by themselves but not together. I have the code
where the first two lines work and when I comment out the first two and
enable the second two lines, the code works for searchval2. What I
want to know is how can I use ELSE with or without the OR statements to
allow me to enable both fields for the search?</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN
class=463185014-19082010></SPAN></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN
class=463185014-19082010> if ($field == "TRS")
{<BR> $rs = $conn->Execute("SELECT * FROM
Surveyor_Image_Link WHERE TRS LIKE '%".$searchval."%' ORDER BY ".$sort."
ASC");<BR>// ) if ($field2 == "DOCTYPE")
{<BR>// $rs = $conn->Execute("SELECT * FROM
Surveyor_Image_Link WHERE DOCTYPE LIKE '".$searchval2."%' ORDER BY
".$sort." ASC");<BR> } else {<BR> echo "You
have reached this page by
mistake.";<BR> }<BR></SPAN></FONT></DIV>
<DIV> </DIV>
<DIV align=left>
<P align=left><FONT size=2 face=Arial>Jim Dahl, GISP<BR>GIS
Coordinator<BR>Douglas County Public Works<BR>526 Willow Dr<BR>PO Box
398<BR>Alexandria MN 56308</FONT></P>
<P><FONT size=2 face=Arial>V 320-762-2933<BR>
320-762-2999<BR>F 320-762-2998</FONT></P></DIV>
<DIV> </DIV></DIV></DIV></BLOCKQUOTE>
<DIV></DIV></DIV><BR></BLOCKQUOTE></DIV></DIV></BLOCKQUOTE>
<DIV style="POSITION: fixed"></DIV></DIV><BR></BLOCKQUOTE></BODY></HTML>