Jump to content


Photo

problem retrieving search results


  • Please log in to reply
No replies to this topic

#1 Theora

Theora
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 01 September 2006 - 08:50 PM

I'm having difficulty with a search page. I followed the instructions in the Dreamweaver Help under "Building search/results pages (ColdFusion, ASP, JSP, PHP)", but it seems like the recordset is not recognizing the variables that are coming from the form. The variables are being passed to the page; I put in a simple "echo($_REQUEST['varFamily']);" line and they show up.

Below is the code being used for the form (most options have been cut for the sake of brevity):
<form action="searchresults.php" method="post" name="searchform" id="searchform">
    <p>Fixture Family:<br />
      <select name="varFamily" id="varFamily">
        <option value="" selected="selected">choose family...</option>
        <option value="Avalon">Avalon</option>
        <option value="Carriage Hills">Carriage Hills</option>
        <option value="Centennial PW">Centennial PW</option>
      </select>
    </p>
    <p>Fixture Finish:<br />
      <select name="varFinish" id="varFinish">
        <option value="" selected="selected">choose finish...</option>
        <option value="Antique Silver Crackle">Antique Silver Crackle</option>
        <option value="Burnt Sienna">Burnt Sienna</option>
      </select>
    </p>
    <p>Fixture Type:<br />
      <select name="varType" id="varType">
        <option value="" selected="selected">choose type...</option>
        <option value="Accessories">Accessories</option>
        <option value="Bath Fixture">Bath Fixture</option>
      </select>
    </p>
    <p>Item Number:<br />
      <input name="itemnumber" type="text" id="itemnumber" />
    </p>
    <p>
    <input type="submit" name="Submit" value="Search" />
  </p>
</form>

Here's a screenshot of the recordset window...
http://img68.imagesh...ecordsetbx3.gif

...and following is the code it generates:
$varFinish_rs_getSearchResults = "%";
if (isset($HTTP_POST_VARS['varFinish'])) {
  $varFinish_rs_getSearchResults = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['varFinish'] : addslashes($HTTP_POST_VARS['varFinish']);
}
$varType_rs_getSearchResults = "%";
if (isset($HTTP_POST_VARS['varType'])) {
  $varType_rs_getSearchResults = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['varType'] : addslashes($HTTP_POST_VARS['varType']);
}
$varItemNumber_rs_getSearchResults = "%";
if (isset($HTTP_POST_VARS['varItemNumber'])) {
  $varItemNumber_rs_getSearchResults = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['varItemNumber'] : addslashes($HTTP_POST_VARS['varItemNumber']);
}
$varFamily_rs_getSearchResults = "%";
if (isset($HTTP_POST_VARS['varFamily'])) {
  $varFamily_rs_getSearchResults = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['varFamily'] : addslashes($HTTP_POST_VARS['varFamily']);
}
mysql_select_db($database_conn_catalog, $conn_catalog);
$query_rs_getSearchResults = sprintf("SELECT * FROM catalog WHERE family LIKE '%s' AND fixturefinish LIKE '%s' AND fixturetype LIKE '%s' AND itemnumber LIKE '%s'", $varFamily_rs_getSearchResults,$varFinish_rs_getSearchResults,$varType_rs_getSearchResults,$varItemNumber_rs_getSearchResults);

Any ideas what I'm doing wrong? Thanks in advance!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users