Help - PHP / FORM SEARCH

[table][tr][td][table][tr][td][size=12px]The problem is, when their is only one field in the form the search works fine… Its when I put other field in the form it does not work… Below is form html and the php search…

////////////// FORM /////////////////////////

Service Type Select Service Hair Salon Nail Salon Spa Multi Salon Services Stylist Braid Weave Beauty Salons

State Alaska Alabama Arizona Arkansas California Colorado DC, Washington Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington West Virginia Wisconsin Wyoming

Zip

            <input name="button" type="submit"   id="button" value="Find" />
            <br />
              <br />
          </div
        
          ><div align="center"></div>
      </form>

/////////////////////// SEARCH PHP //////////////////////////////

<?php // Connect to database include_once "scripts/connect_to_mysql.php"; // DEAFAULT QUERY STRING $queryString = "WHERE email_activated='1' ORDER BY id ASC"; // DEFAULT MESSAGE ON TOP OF RESULT DISPLAY $queryMsg = "Showing Senior to Newest members by Default"; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////// SET UP FOR SEARCH CRITERIA QUERY SWITCH MECHANISMS //////////////////////////////////////////////////////////////// if($_POST['listByq'] == "by_zip"){ $zip = $_POST['zip']; $zip = stripslashes($zip); $zip = strip_tags($zip); $zip = mysql_real_escape_string($zip); $queryString = "WHERE zip LIKE '%$zip%' AND email_activated='1'"; $queryMsg = "Showing Members with the zip you searched for"; } else if($_POST['listByq'] == "by_businesstype"){ $businesstype = $_POST['businesstype']; $businesstype = stripslashes($businesstype); $businesstype = strip_tags($businesstype); $businesstype = mysql_real_escape_string($businesstype); $queryString = "WHERE businesstype LIKE '%$businesstype%' AND email_activated='1'"; $queryMsg = "Showing Members with the businesstype you searched for"; } else if ($_POST['listByq'] == "by_state") { $state = $_POST['state']; $state = stripslashes($state); $state = strip_tags($state); $state = eregi_replace("'", "", $state); $state = mysql_real_escape_string($state); $queryString = "WHERE state LIKE '%$state%' AND email_activated='1'"; $queryMsg = "Showing Members with the State you searched for"; } /////////////// END SET UP FOR SEARCH CRITERIA QUERY SWITCH MECHANISMS /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Result after search: Showing Senior to Newest members by Default [/size] [/td] [/tr] [tr] [td] [/td] [/tr] [/table][/td] [td] [img width=100]http://www.developphp.com/dev_forum/user_pics/12462.jpg[/img] [img width=240]http://www.developphp.com/dev_forum/user_pics/12462.jpg[/img] Don Forum & Site XP Level: [img]http://www.developphp.com/forum/images/xp_star_grey.jpg[/img] United States of America pa Philadelphia [img alt=Aquarius]http://www.developphp.com/forum/images/zodiacPics/Aquarius.jpg[/img]Aquarius Posts: 7 Joined: 08/08/10 [/td] [/tr] [/table]

What is the Problem ?

Sponsor our Newsletter | Privacy Policy | Terms of Service