[Geomoose-users] Need help with ELSE / OR statements

Jim Dahl jim.dahl at mail.co.douglas.mn.us
Thu Aug 19 10:56:08 EDT 2010


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?
 
  if ($field == "TRS") {
    $rs = $conn->Execute("SELECT * FROM Surveyor_Image_Link WHERE TRS
LIKE '%".$searchval."%' ORDER BY ".$sort." ASC");
//  ) if ($field2 == "DOCTYPE") {
//    $rs = $conn->Execute("SELECT * FROM Surveyor_Image_Link WHERE
DOCTYPE LIKE '".$searchval2."%' ORDER BY ".$sort." ASC");
  } else {
    echo "You have reached this page by mistake.";
  }

 

Jim Dahl, GISP
GIS Coordinator
Douglas County Public Works
526 Willow Dr
PO Box 398
Alexandria MN 56308

V 320-762-2933
   320-762-2999
F 320-762-2998

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20100819/03d4e11d/attachment.html


More information about the Geomoose-users mailing list