Create price range search function in php recordset

Hi,
On a continuation from a previous thread, I am finding that the expertise of the web designers on these forums is proving much more educational and beneficial than the vast numbers of books I have bought to setup a website for my property company. (Without sounding too sycophantic!).
I have managed to create a working website where the properties in my database and their related images are pulled into a recordset on the live webpage and everything is working perfectly. I do however want to add some simple filters on the search page to narrow down the results from the database.
I am finding that given one push or piece of coding I can work out the rest myself. Therefore, all I would like to do is create a price range drop down, where clients can select properties from the database in one of 3 categories: under £1m, £1m-£2m, and over £2m.
As I understand it, I need two pages to do this, one html form page where the clients will input their search criteria with coding similar to:
<form action="search_results.php" method="post" name="search" id="search" >
Price Range:
<select name="prop_price" id="select8">
<option value="<1000000">             >£1,000,000                   </option>
<option value="1000000-2000000">    £1,000,000 - £2,000,000</option>
<option value=">2000000">             >£2,000,000                   </option>
</select>
<input name="search" type="submit" id="search" value="search">
</form>
(apologies for my messy coding - I am still new and not sure if certain fields arent required yet!).
Then, I would need to create the search_results.php page which would give the results of properties in the database depending on the price range submitted. I have tried various different methods put online through the forums, but cannot seem to get anything post 2006, nor anything that has actually worked. I am using Dreamweaver CS5 and MySQL for my db.
How do I incorporate the above search criteria into a dynamic php doc? The only way I have managed to get something working is to create a new page for each of the price variables -something which is incredibly inefficient, and hardly something that can be developed easily going forward.
The php code I currently have that is retrieving all the properties from my database is as follows (connection name is test, recordset name is getDetails):
<?php require_once('Connections/test.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;   
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  return $theValue;
$maxRows_getDetails = 20; 
$pageNum_getDetails = 0; 
if (isset($_GET['pageNum_getDetails'])) { 
   $pageNum_getDetails = $_GET['pageNum_getDetails']; 
$startRow_getDetails = $pageNum_getDetails * $maxRows_getDetails;
mysql_select_db($database_test, $test);
$query_getDetails = "SELECT id, prop_name, prop_price, country, post_code, short_desc, image FROM images order by prop_price DESC";
$query_limit_getDetails = sprintf("%s LIMIT %d, %d", $query_getDetails, $startRow_getDetails, $maxRows_getDetails); 
$getDetails = mysql_query($query_limit_getDetails, $test) or die(mysql_error());
$row_getDetails = mysql_fetch_assoc($getDetails);
if (isset($_GET['totalRows_getDetails'])) { 
   $totalRows_getDetails = $_GET['totalRows_getDetails']; 
} else { 
   $all_getDetails = mysql_query($query_getDetails); 
   $totalRows_getDetails = mysql_num_rows($all_getDetails); 
$totalPages_getDetails = ceil($totalRows_getDetails/$maxRows_getDetails)-1;
?>
<table width="990" border="0" align="center" cellpadding="0" cellspacing="0"> 
     <tr>   
     </tr> 
     <?php do { ?> 
       <tr>   
         <td><img src="show_image.php?id=<?php echo $row_getDetails['id']; ?>"></td> 
         <td><?php echo $row_getDetails['prop_name']; ?></td>
         <td><?php echo $row_getDetails['prop_price']; ?></td>
         <td><?php echo $row_getDetails['short_desc']; ?></td>
         </tr> 
         <?php } while ($row_getDetails = mysql_fetch_assoc($getDetails)); ?> 
         </table> 
<?php
mysql_free_result($getDetails);
?>
Essentially, I need to incorporate the WHERE function into my sql query, but how do I do this so that it is dependent on the clients submission on the search page.......?
Sorry if this is incredibly easy, but I am at a complete loss now and cant try any more techniques from the various forums out there! I even downloaded the entire Zen cart framework just to see if I could find something in the vast numbers of php pages that came with it!
Hope someone can help -
Thanks
Jack

Hi Gunter,
Thanks for your quick response. I thought I had it but not quite yet. I uploaded these pages into live browser but am only getting the following on the search results page:
This is the case for all three parameters. As I have not yet uploaded all the properties into mysql, there are only 2 live ones in there, one is prop_price at 600,000 (int) and the other prop_price 2300000 (int). For the query to work, should this field in mysql be a different format?
For your reference, the new show_results.php code is:
<?php require_once('Connections/test.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;  
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  return $theValue;
$maxRows_getDetails = 20;
$pageNum_getDetails = 0;
if (isset($_GET['pageNum_getDetails'])) {
   $pageNum_getDetails = $_GET['pageNum_getDetails'];
$startRow_getDetails = $pageNum_getDetails * $maxRows_getDetails;
if(isset($_POST['prop_price']))
switch($_POST['prop_price'])
  case ("a"):
$price_whereclause = ' WHERE prop_price < 1000000 ';
  break;
  case ("b"):
$price_whereclause  = ' WHERE prop_price BETWEEN 100000 AND 200000 ';
  break;
  case ("c"):
$price_whereclause  = ' WHERE prop_price < 2000000 ';
  break;
else {
$price_whereclause  = '';
mysql_select_db($database_test, $test);
$query_getDetails = "SELECT id, prop_name, prop_price, country, post_code, short_desc, image FROM images ".$price_whereclause." order by prop_price DESC";
$query_limit_getDetails = sprintf("%s LIMIT %d, %d", $query_getDetails, $startRow_getDetails, $maxRows_getDetails);
$getDetails = mysql_query($query_limit_getDetails, $test) or die(mysql_error());
$row_getDetails = mysql_fetch_assoc($getDetails);
if (isset($_GET['totalRows_getDetails'])) {
   $totalRows_getDetails = $_GET['totalRows_getDetails'];
} else {
   $all_getDetails = mysql_query($query_getDetails);
   $totalRows_getDetails = mysql_num_rows($all_getDetails);
$totalPages_getDetails = ceil($totalRows_getDetails/$maxRows_getDetails)-1;
?>
<table width="990" border="0" align="center" cellpadding="0" cellspacing="0">
     <tr>  
     </tr>
     <?php do { ?>
       <tr>  
         <td><img src="show_image.php?id=<?php echo $row_getDetails['id']; ?>"></td>
         <td><?php echo $row_getDetails['prop_name']; ?></td>
         <td><?php echo $row_getDetails['prop_price']; ?></td>
         <td><?php echo $row_getDetails['short_desc']; ?></td>
         </tr>
         <?php } while ($row_getDetails = mysql_fetch_assoc($getDetails)); ?>
         </table>
<?php
mysql_free_result($getDetails);
?>
I know its very cheeky, but assuming you can help with fixing this, where in the coding would I insert a "No properties returned. Please try another query" response should the db not have anything in the set parameters (instead of the symbol currently being displayed).
Again thanks so much for all your help.
Jack

Similar Messages

  • How to create a file search function

    I'm using Dreamweaver 8. I've created several websites but this is my first foray into a search function. I have a form ready to go with text box and search(submit) button. This website is for apartment property managers. I need users to be able to search "60 Day Renewal Form" and have a list of documents pop up that have those words in the title. I have all of the documents relative to the site in a folder sitting on the server (Windows Server 2003). I don't know where to begin. Please let me know if you need any more information. Thank you.  

    What type of documents are you searching? Basically, what you need is a web site search engine. You can start by look at zoom and see if that meets your needs.
    http://www.wrensoft.com/zoom/

  • Advanced search for a price range while checking for an empty values using php in DW

    I am creating an advanced search with DW php. I would like to submit a search where some entrys can be left black. So checking for empty values (which I have managed, thank you David Powel), however when searching between multiple price ranges does not seem to work.
    please see attached forms:
    The search page:
    <form action="Detailed-Search-Result.php" method="get" target="_self"><table width="90%" border="0" cellspacing="0" cellpadding="2">
      <tr>
        <td colspan="2"><label for="Detailed Search">Advanced Search</label></td>
        </tr><tr>
        <td><label for="Product">Product:</label>
          </td>
        <td><select name="Category" id="Category">
          <option value=></option>
            <option value="Keyboard">Keyboard</option>
            <option value="Piano">Piano</option>
          </select></td>
      </tr>
      <tr>
        <td><label for="Make">Make:</label>
        </td>
        <td><select name="Manufacturer">
          <option value=></option>
          <option value="Boss">Boss</option>
          <option value="Casio">Casio</option>
          <option value="Kawai">Kawai</option>
          <option value="Ketron">Ketron</option>
          <option value="Korg">Korg</option>
          <option value="Roland">Roland</option>
          <option value="Samson">Samson</option>
          <option value="Yamaha">Yamaha</option>
        </select></td>
      </tr>
      <tr>
        <td><label for="Color">Color:</label></td>
        <td><select name="Color">
          <option value=></option>
          <option value="Black">Black</option>
          <option value="Cherry">Cherry</option>
          <option value="Mahogany">Mahogany</option>
          <option value="Polished Eboney">Polished Eboney</option>
          <option value="Rosewood">Rosewood</option>
          <option value="White">White</option>
          <option value="Red">Red</option>
        </select></td>
      </tr>
      <tr>
        <td><label for="Price">Price:</label></td>
        <td><select name="Price">
          <option value=></option>
          <option value="0-500">£0-500</option>
          <option value="500-1000">£500-1000</option>
          <option value="1000-2000">£1000-2000</option>
          <option value="2000">£2000&gt;</option>
        </select></td>
      </tr>
      <tr>
        <td colspan="2">
          <input name="Search2" type="submit" id="Search2"></td>
        </tr>
        </table>
    </form>
    The results page
    $varCategory_rsgetsearch2 = "%";
    if (isset($_GET['Category'])) {
      $varCategory_rsgetsearch2 = $_GET['Category'];
    $varMake_rsgetsearch2 = "%";
    if (isset($_GET['Manufacturer'])) {
      $varMake_rsgetsearch2 = $_GET['Manufacturer'];
    $varColor_rsgetsearch2 = "%";
    if (isset($_GET['Color'])) {
      $varColor_rsgetsearch2 = $_GET['Color'];
    $varPrice_rsgetsearch2 = "%";
    if (isset($_GET['Price'])) {
      $varPrice_rsgetsearch2 = $_GET['Price'];
    mysql_select_db($database_dBconn, $dBconn);
    $query_rsgetsearch2 = 'SELECT * FROM products';
    $where = false;
    if (isset($_GET['Category']) && !empty($_GET['Category'])) {
    $query_rsgetsearch2 .= ' WHERE Category LIKE varCategory '. GetSQLValueString($_GET['Category'], 'text');
      $where = true;
    if (isset($_GET['Manufacturer']) && !empty($_GET['Manufacturer'])) {
      if ($where) {
       $query_rsgetsearch2 .= ' AND ';
      } else {
       $query_rsgetsearch2 .= ' WHERE ';
        $where = true;
    $query_rsgetsearch2 .= 'Manufacturer LIKE varManufacturer ' . GetSQLValueString($_GET['Manufacturer'], 'text');
    if (isset($_GET['Color']) && !empty($_GET['Color'])) {
        if ($where) {
       $query_rsgetsearch2 .= ' AND ';
      } else {
       $query_rsgetsearch2 .= ' WHERE ';
        $where = true;
      $query_rsgetsearch2 .= 'Color LIKE varColor ' . GetSQLValueString($_GET['Color'], 'text');
    if (isset($_GET['Price']) && !empty($_GET['Price'])) {
        if ($where) {
       $query_rsgetsearch2 .= ' AND ';
      } else {
       $query_rsgetsearch2 .= ' WHERE ';
        $where = true;
    switch( $_GET['Price'] ){
            case '0-500':
            $query_rsgetsearch2 .= '  RRP BETWEEN 0 AND 500 ORDER BY price ASC'. GetSQLValueString($_GET['Price'], 'text');
            break;
              case '500-1000':
            $query_rsgetsearch2 .= ' RRP BETWEEN 500 AND 1000 ORDER BY price ASC'. GetSQLValueString($_GET['Price'], 'text');
            break;
                        case '1000-2000':
            $query_rsgetsearch2 .= ' RRP BETWEEN 1000 AND 2000 ORDER BY price ASC'. GetSQLValueString($_GET['Price'], 'text');
            break;
              case '2000':
           $query_rsgetsearch2 .= ' RRP BETWEEN 2000 AND 10000 ORDER BY price ASC'. GetSQLValueString($_GET['Price'], 'text');
            break;
    $query_rsgetsearch2 = sprintf("SELECT * FROM products WHERE Category LIKE %s AND products.Manufacturer LIKE %s AND products.Color LIKE %s", GetSQLValueString("%" . $varCategory_rsgetsearch2 . "%", "text"),GetSQLValueString("%" . $varMake_rsgetsearch2 . "%", "text"),GetSQLValueString("%" . $varColor_rsgetsearch2 . "%", "text"));
    $query_limit_rsgetsearch2 = sprintf("%s LIMIT %d, %d", $query_rsgetsearch2, $startRow_rsgetsearch2, $maxRows_rsgetsearch2);
    $rsgetsearch2 = mysql_query($query_limit_rsgetsearch2, $dBconn) or die(mysql_error());
    $row_rsgetsearch2 = mysql_fetch_assoc($rsgetsearch2);
    I would be greatfull for any help

    I have managed to solve the problem.
    In the end I didn't check if the values were empty, as it worked fine without. However the switch of the price didn't work in combination with the rest of the query.
    I've solved the problem as follows:
    $varCategory_rsgetsearch2 = "%";
    if (isset($_GET['Category'])) {
      $varCategory_rsgetsearch2 = $_GET['Category'];
    $varMake_rsgetsearch2 = "%";
    if (isset($_GET['Manufacturer'])) {
      $varMake_rsgetsearch2 = $_GET['Manufacturer'];
    $varColor_rsgetsearch2 = "%";
    if (isset($_GET['Color'])) {
      $varColor_rsgetsearch2 = $_GET['Color'];
    $varPrice_rsgetsearch2 = "%";
    if (isset($_GET['Keysound_price'])) {
      $varPrice_rsgetsearch2 = $_GET['price'];
    mysql_select_db($database_dBconn, $dBconn);
    $query_rsgetsearch2 = sprintf("SELECT * FROM products WHERE Category LIKE %s AND products.Manufacturer LIKE %s AND products.Color LIKE %s", GetSQLValueString("%" . $varCategory_rsgetsearch2 . "%", "text"),GetSQLValueString("%" . $varMake_rsgetsearch2 . "%", "text"),GetSQLValueString("%" . $varColor_rsgetsearch2 . "%", "text") );
    switch( $_GET['price'] ){
            case '0-500':
            $query_rsgetsearch2 .= ' AND price BETWEEN 0 AND 500 ORDER BY price ASC';
            break;
              case '500-1000':
            $query_rsgetsearch2 .= ' AND price BETWEEN 500 AND 1000 ORDER BYprice ASC';
            break;
                        case '1000-2000':
            $query_rsgetsearch2 .= ' AND price BETWEEN 1000 AND 2000 ORDER BY price ASC';
            break;
              case '2000':
            $query_rsgetsearch2 .= ' AND price BETWEEN 2000 AND 10000 ORDER BY price ASC';
            break;
    $query_limit_rsgetsearch2 = sprintf("%s LIMIT %d, %d", $query_rsgetsearch2, $startRow_rsgetsearch2, $maxRows_rsgetsearch2);
    $rsgetsearch2 = mysql_query($query_limit_rsgetsearch2, $dBconn) or die(mysql_error());
    $row_rsgetsearch2 = mysql_fetch_assoc($rsgetsearch2);
    I'm sure that you can keep the checking for values in, however for me the was no need for it anymore.
    Thanks for all your help

  • How to create search function (af:query) using method in java

    hi All..:)
    i got problem with search custom (af:query), how to create search function/ af:query using method in java class?
    anyone help me....
    thx
    agungdmt

    Hi,
    download the ADF Faces component demo sources from here: http://www.oracle.com/technetwork/testcontent/adf-faces-rc-demo-083799.html It also has an example for creating a custom af:query model
    Frank

  • Create Search Function in Flash

    Hi
    I'm in the process of creating a large scale website in flash
    with several pages and lots of information. In able for the user to
    find the information they are looking for I would like to create a
    search function that can search through the site and return the
    results with links to the pages.
    It's just like the common search functions you often see on
    the nowadays webpages. Any suggestions on how to create one?
    All answers would be appreciated.
    Thanks

    I also am interested in the answer to this question.
    I would rather use flash to create the search portion of the
    website than to use a form.
    Any help on this would be greatly appreciated.

  • How to auto create Report Search functions and Breadcrumb Menu on new pages

    Hi
    First off I want to say I have just started using Html DB, and think its a great product! I have been using it for a few months now to create an application, and find it flexible, powerful, but still fairly simple to use.
    When I create a new Application using "Based on Existing Tables", the pages that get created have some very nice Report Search functions and Breadcrumb Menu features generated automatically.
    I want to do the same when I add pages to an existing application. That is, I want new pages to automatically include those Report Search functions and Breadcrumb Menu features.
    I have tried various combinations of the existing wizards, but I have not been able to find any that generate all those features automatically. I know I can create pages using the page wizard, and then manually add the Report Search and Breadcrumb Menu. But that is very tedious. Nor can I find a better answer in the forum
    Any suggestions or ideas?
    Thanks
    Richard

    Can you show the scripts and reports screenshort, so we can have a clerarl idea.
    madni

  • Creating a Formatted Search in Item Master based on Unit Price

    Hi Experts,
    I have to create a Formatted Search for assigning the Standard Cost of Items as Selling Price-Selling Price*.05  i.e the Standard cost of the item should be set upon automatically equal to 5% less of Selling Price .
    I have created the following Formatted Search Query :
    SELECT ((SELECT $[$34.68.NUMBER])-(SELECT $[$34.68.NUMBER] *.05))
    and have assigned this FS to Standard Cost Field . I am not able to base it upon Unit Price field . This FS is correct but it is not automatically refreshing upon change of Unit Price and I have to manually update it(ALT+F2) . I guess the filed upon which it should be based upon is not correct .
    please guide me how to resolve this issue . How to base this FS upon Unit Price.
    Thanks and Regards,
    Pooja Singh.

    Hi,
    Actually I dont want to set upon the last No for the Series. What about the Sequence ? Administration->setup->financials->Tax->Sequence. Here also the same thing can be done but Location Specific. When I created 2 Series for the two different locations , I found that two different fields appeared on the screen Sequence Name Where I found the two sequences I defined for the two locations. If you have any idea about what this sequence is for and how far is it different from Document Series , please let me know.
    Thanks and Regards,
    Pooja Singh

  • HOW TO CREATE A KEYWORD SEARCH FORM

    Hi, I'm creating a image gallery and I'm about 90% complete. One of my  final objectives is to create a keyword search for my image gallery. I  have 4 fields in my DB, (id,image,description,keywords) I want to be  able to enter keywords into the text field  and the images with there  descriptions show up. I already have the  keywords in my mysql, I already know how to use mysql, I just need to learn how to add a search form that pulls keywords from my mysql. THIS DOES NOT REQUIRE ANY CODE so please do not respond with code. I just need a step by step on what type of form to insert, (dynamic text field or text field) what paramaters to pass etc. NO CODE, this whole thing can be done in design veiw.
    For this project I'm using Dreamweaver Cs5, I'm not really an  experienced coder I rely heavily on dreamweaver for my code, I just make  minor tweaks. So if anyone has an answer to my problem please break  down and simplify your answer I'm still a beginner. Thanks in advance.
    ps
    If anyone knows of any other video tutorials of this process please inform me, it would be greatly appreciated, thank you.(not php acedemies)

    This is helpfull but I'm still running in to some problems. I believe everything on my search page is correct, I think it's my results page thats giving me issues.  When I view my search page in firefox and type in a keyword in the text field, when the results page loads all I get is the field names of DB table (id,layouts,desription,key_words) instead of the actual data...??
    On my search page in the action box I have my results page "search_results.php". In the method box I have "GET".  On my "search_ruselts.php" page I created a recordset, selected all columns, and filtered "key_words". (im not sure if I filtered correctly) I placed this in a dynamic table. Where did I go wrong?
    this is my code if it helps any
    search page:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <form id="form1" name="form1" method="get" action="search_results.php">
      <label for="textfield"></label>
      <input type="text" name="textfield" id="textfield" />
      <input type="submit" name="button" id="button" value="Submit" />
    </form>
    </body>
    </html>
    results page:
    <?php require_once('Connections/test_db.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $maxRows_Recordset1 = 10;
    $pageNum_Recordset1 = 0;
    if (isset($_GET['pageNum_Recordset1'])) {
      $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
    $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
    $colname_Recordset1 = "-1";
    if (isset($_GET['key_words'])) {
      $colname_Recordset1 = $_GET['key_words'];
    mysql_select_db($database_test_db, $test_db);
    $query_Recordset1 = sprintf("SELECT * FROM images2 WHERE key_words = %s ORDER BY id DESC", GetSQLValueString($colname_Recordset1, "text"));
    $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
    $Recordset1 = mysql_query($query_limit_Recordset1, $test_db) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    if (isset($_GET['totalRows_Recordset1'])) {
      $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
    } else {
      $all_Recordset1 = mysql_query($query_Recordset1);
      $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
    $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
    $colname_Recordset2 = "-1";
    if (isset($_GET['id'])) {
      $colname_Recordset2 = $_GET['id'];
    mysql_select_db($database_test_db, $test_db);
    $query_Recordset2 = sprintf("SELECT * FROM images2 WHERE id = %s ORDER BY id DESC", GetSQLValueString($colname_Recordset2, "int"));
    $Recordset2 = mysql_query($query_Recordset2, $test_db) or die(mysql_error());
    $row_Recordset2 = mysql_fetch_assoc($Recordset2);
    $totalRows_Recordset2 = mysql_num_rows($Recordset2);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <table cellpadding="4" cellspacing="4">
      <tr>
        <td>id</td>
        <td>Layouts</td>
        <td>Descriptions</td>
        <td>key_words</td>
      </tr>
      <?php do { ?>
        <tr>
          <td><?php echo $row_Recordset1['id']; ?></td>
          <td><?php echo $row_Recordset1['Layouts']; ?></td>
          <td><?php echo $row_Recordset1['Descriptions']; ?></td>
          <td><?php echo $row_Recordset1['key_words']; ?></td>
        </tr>
        <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
    </table>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    mysql_free_result($Recordset2);
    ?>

  • Best / most popular software or scripts for adding search function to website?

    I'm trying to find a good piece of software or script for implementing a site search function into our website.  I am relatively knowledgeable in Dreamweaver and can write CSS and XHTML at the fairly intermediate to advanced level, as well as work with JavaScript and js files, but I don't really know much ASP or "by hand" Java coding.  Their are so many scripts and software out there for adding a site search that it's hard to sort through and narrow down.  I was hoping to find reviews of the popular ones or "top 10 lists" of some sort that would help me pinpoint a good one, but can't find anything like that.  These are the primary needs of the website:
    --Has under 50 searchable pages that won't change much and probably won't exceed 50. There are product part numbers and descriptions for some 250-300 part numbers, spread across only 24 of those pages.  The remaining pages are important but no part numbers-- About Us, News, Where to Buy, History, Featured Products, etc.  The product pages are very much like an online store but we don't sell directly on the site (only thru distributors/reps).
    --We are trying to keep the price under about $50, or use a free solution
    --The pages are all static XHTML+CSS pages, but our server can run ASP (we have another website for one of our other product line divisions, on the same server, with many more products beyond 1000, which was programmed completely in ASP by an outside company about 4 years ago).  We self-host both sites.
    --Our server can't run PHP
    --The search capabilities need only be rather basic-- a keyword search with a results page that uses the same design template as the rest of the site.  It would be nice, but not mandatory, to have a search filter and/or a drop down menu to enable selectively searching only certain parts of the site, or only product/part number search vs. general search, etc. (but again, not mandatory).
    --I do have a sitemap page already on it, if that matters or helps
    Some of the ones I've found so far that looked the most promising include:  Zoom Search Engine (http://www.wrensoft.com/zoom/), Site Search Pro (http://www.site-search-pro.com/), and FX Site Search which is a DW Extension I found in the exchange (http://www.felixone.it/extensions/prod/mxssen.asp)-- (that one looks possibly technically challenging or requiring more ASP skill, though)
    Forgive me if there is a better area to post this, if so let me know.

    For a static site, your options are:
    Google ~  http://www.google.com/sitesearch/
    Freefind ~ http://www.freefind.com/
    Zoom from Wrensoft ~ http://www.wrensoft.com/zoom/
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/

  • Problem mimicking ASP's GetRow function in PHP

    I am new to PHP but not to scripting. I am developing a web app using PHP/MySql that will let a particular client's employees set up and order their business cards. I have a Mac running InDesign CS4 and a set of scripts that will take a text file and make the business card out of it automatically. I also have a MySQL database and a PHP-based Dreamweaver site that does everything other than make the text file I need.
    For clarity, let me give you the rundown on what happens with this app. What I want to do is have the client login with generic credentials, go through an initial setup where they develop new credentials, as well as all the data to be used later in their business cards and possibly other printed materials. After they submit that info they are taken to another login page where they use their new credentials to go to the main page for them, with links for ordering business cards, updating their personal information, and looking at all their previous orders. When they choose to order more cards, they go to a page that lets them see how the data will look on their card. If they don't like the way it looks, there is a link that lets them update their info and leads them back to the order page. If they like it and want to see a PDF preview of their card, they can click a button that will drop out a text file, which should have a name with a reference in it as being temporary plus a counter that make it unique, into a hot folder on the server that the mac with InDesign picks up, formats, and outputs a PDF that is then mailed to the client. If they like the preview, they choose choose a quantity for their order and submit a form with hidden fields that not only posts an entry to the database but also generates another text file that makes the final PDF for the business card. This final PDF gets mailed back to the client as well as the CSR handling the account so they can enter a job ticket to get it printed. This final text file contains references to the order number
    Of all the stuff I just mentioned, the two things I am having problems with is making the text files for the preview and the final PDFs. I have already written code that will save a file using fopen(). The problem I am having is passing user data from the database into an array so I can use it to fill the file with relevant information for the InDesign scripts. The other is passing the new order number to the final text files name, and getting a number for the temporary text file's counter. I assume that I can merely ask the database for the greatest order number and temporary number. But I have to get those things into variables that I can use to concatenate a string for the file names.
    In my research I found that ASP has a great command called GetRow that will make pass a row of data into a 2d array. I also found a nice piece of code where you can get PHP to mimc the same trick. Here it is (written by a user named bastion at http://www.codewalkers.com/c/a/Database-Code/Mimic-ASPs-GetRows-functionality-in-PHP/).
    <?
    function GetRows($handle)
    This function emulates the ASP GetRows function. It creates a 2 dimensional
    array of the data set where the :
    1st dimension is the row number of the data
    2nd dimension are the data fields
    Returns a two dimensional array if there are record or false if no records
    come out of the query
    if (mysql_num_rows($handle)>0){
    //initialize the array
    $RsArray1 = array();
    //loop thru the recordset
    while ($rows = mysql_fetch_array($handle))
    $RsArray1[] = $rows;
    } //wend
    return $RsArray1;
    }else{
    //no records in recordset so return false
    return false;
    } //end if
    //close the connection
    mysql_close($handle);
    } //end function
    ?>
    My problem now is figuring out what he means by the variable $handle. What is this a reference to? Is it the name of the database connection? The recordset? One of the other many variables Adobe's code for a recordset has in it? If my database connection is called dbconnection, and the recordset for the user data from that connection is called rsUsers, what do I literally put into this function's parameters when I call it in my code for the page? When I call this function and return its value into a new array called $user_data_arr, how do I reference its values so I can create a string to save into the text file? Can I use this same function to call rsOrders, get the latest order number and put it into an array, and add 1 to it so I can generate the file name? Or is there a better way to do this that I don't know about?

    This might help. I wrote it a couple of years ago and it workds fine for blobs you will more then likely be able to adapt it.
    <?php
    $db = "[your SID]" ;
    $dbuser = "[user name]" ;
    $dbpword = "password]" ;
    $OraDB = oci_connect($dbuser,$dbpword,$db);
    $ImageFileName = "/srv/www/htdocs/moon_landing_map.jpg" ;
    $ImageFile = fopen($ImageFileName,"rb");
    $Image = fread($ImageFile,filesize($ImageFileName));
    $ImageID = 2 ;
    $query = "insert into blob_test (id,description,image_data) values (:ImageID,'Test Image',EMPTY_BLOB()) returning image_data into :image_data" ;
    $Stmt = oci_parse($OraDB,$query);
    $Blob = oci_new_descriptor($OraDB,OCI_D_LOB);
    oci_bind_by_name($Stmt, ':ImageID',$ImageID);
    oci_bind_by_name($Stmt, ':image_data', $Blob, -1, OCI_B_BLOB);
    oci_execute($Stmt,OCI_DEFAULT);
    $Blob->save($Image);
    oci_commit($OraDB);
    $Blob->close() ;
    oci_close($OraDB);
    fclose($ImageFile);
    ?>and here is the code to get a blob out!
    <?php
    $db = "[your SID]" ;
    $dbuser = "[user name]" ;
    $dbpword = "[password]" ;
    $OraDB = oci_connect($dbuser,$dbpword,$db);
    $Image = "";
    $ImageID = $_GET['id'] ;
    $query = "select image_data from blob_test where id = :ImageID" ;
    $Stmt = oci_parse($OraDB,$query);
    oci_bind_by_name($Stmt, ':ImageID', $ImageID);
    oci_execute($Stmt);
    $arr = oci_fetch_array($Stmt,OCI_ASSOC);
    $Image = $arr['IMAGE_DATA']->load();
    $arr['IMAGE_DATA']->free() ;
    oci_close($OraDB);
    echo $Image ;
    ?>Edited by: FlyingGuy on Feb 25, 2011 11:16 AM

  • Equivalent to EVAL function in PHP?

    Based on what option the user selects from my select list, my APEX report of type SQL query should be rendered.
    This works fine for situations like:
    SELECT * FROM table_name WHERE field_name = :P101_item_name
    But here I face the problem:
    In case the user selects option one, I want to fetch all rows, where field_name = NULL, if she selects the second option all rows with field_name <> NULL should be fetched. If she selects the third option, all options should be retrieved.
    I e.g. tried to create the static List of Values and assigned to the options the values "NULL", "NOT NULL"..
    yet
    SELECT * FROM table_name WHERE field_name is :P101_item_name
    does not work..
    How can I solve this? Is there any function similar to the eval function of php? Thanks a lot.

    In PL/SQL land the equivalent is EXECUTE IMMEDIATE - essentially allowing you to execute dynamic SQL.
    In APEX, you have various other options available to you. For instance, we can create PL/SQL anonymous blocks that return SQL or indeed functions that take arguments and return a SQL string. APEX will then handle the process of taking this string, EXECUTE IMMEDIATE'ing it, and returning your desired report.
    See here for a good discussion.
    Re: Passing a Table Name as a variable to a Page Process
    Also search for 'dynamic SQL', 'dynamic table names', 'dynamic LOVs' on the forum as this comes up regularly related to LOV filters.

  • Can we collect email addresses and build a search function?

    We want to build an app using InDesign, DPS and Edge Animate (plus some custom html5 and javascript if necessary/possible).
    We'd like to have a form somewhere in the app where users can enter their email addresses if they want to receive email from us. Is this possible with these tools and some html5 and javascript brought in to InDesign?
    Can we build a search function within the app that searches all the text?
    I understand that by using a Folio Overlay, the app can bring in a web page. So, could we, for example, create a web page that shows latest stock prices, and then bring that into the Folio Overlay, so that the user always sees those latest prices? What happens if the user's iPad is not connected to the internet? Can we set a default image for the overlay? Also, will the app remember the page it downloaded last time if it can't connect at a later date?
    Thanks.

    Hi,
    We developed the first example of search within a DPS folio for the Sotheby's app. In addition, MEI  integrated search within the core of our DPS storefront and custom UI solution, MEI Portico. Within a Portico-powered UI, you can search for folios, specific articles and other content and can then navigate directly to the desired content.
    Please feel free to reach out to discuss.
    Best,
    Brett Kizner
    Product Marketing Director
    MEI
    [email protected]

  • IPhone 5s Voice memo to mp3. Now music on iPhone. Won't play from search function.

    I record my band rehearsals using the voice memo on my iPhone 5s. Then I sync to iTunes and convert file to mp3. When i sync back to my iPhone it appears in my music. So far, so good. When I use the search function in music it finds the file but won't play from tapping. I must troll through all my music songs (currently 2227 of them) to find it and then play it. Is it something to do with it still being under the genre "voice memos" or what ?  Anybody help please.  Thanks

    iWeb is an application to create webpages with.
    It used to be part of the iLife suite of applications.
    iWeb has no knowledge of the internal speaker on your iPhone.
    You may want to ask in the right forum.

  • Create SharePoint 2010 Search Service Application Using Powershell

    Hi Team,
    Could you please assist me in completing the search service application for
    two server using powershell. Both the servers will be running all the component
    Version SharePoint 2010
    # 1.Setting up some initial variables.
    write-host 1.Setting up some initial variables.
    $SSAName = "Search Service Application"
    $SVCAcct = "Domain\ServiceAccount"
    $SearchAppPoolName ="DefaultAppPool"
    $SSI = get-spenterprisesearchserviceinstance -local
    $err = $null
    $SSADBName="Search_AdminDB"
    $SSADBServer="DBServer"
    $host1="Server1"
    $host2="Server2"
    # Start Services search services for SSI
    write-host Start Services search services for SSI
    Start-SPEnterpriseSearchServiceInstance -Identity $SSI
    # 2.Create an Application Pool.
    write-host 2.Create an Application Pool.
    #$AppPool = new-SPServiceApplicationPool -name $SSAName"-AppPool" -account $SVCAcct
    $AppPool = Get-SPServiceApplicationPool -Identity $SearchAppPoolName -ErrorAction SilentlyContinue
    # 3.Create the SearchApplication and set it to a variable
    write-host 3.Create the SearchApplication and set it to a variable
    $SearchApp = New-SPEnterpriseSearchServiceApplication -DatabaseServer $SSADBServer -Name $SSAName -applicationpool $AppPool -databasename $SSADBName
    #4 Create search service application proxy
    write-host 4 Create search service application proxy
    $SSAProxy = new-spenterprisesearchserviceapplicationproxy -name $SSAName"ApplicationProxy" -Uri $SearchApp.Uri.AbsoluteURI
    # 5.Provision Search Admin Component.
    write-host 5.Provision Search Admin Component.
    set-SPenterprisesearchadministrationcomponent -searchapplication $SearchApp -searchserviceinstance $SSI
    # 6.Create a new Crawl Topology.
    write-host 6.Create a new Crawl Topology.
    $CrawlTopo = $SearchApp | New-SPEnterpriseSearchCrawlTopology
    New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
    Source:blog.MSDN Author- Russ Maxwell
    Thanks Basva

    Could you please assist me in completing the search service application for
    two server using powershell. Both the servers will be running all the component 
    Hi Basva,
    Do you want to provision two search service applications in single farm?
    Commonly, only one search service application is needed in a farm for Search function.
    Here are articles for detail information about how to provision search service application using powershell:
    http://blogs.msdn.com/b/jjameson/archive/2011/02/28/powershell-script-to-configure-search-in-sharepoint-server-2010.aspx
    http://blogs.msdn.com/b/russmax/archive/2009/10/20/sharepoint-2010-configuring-search-service-application-using-powershell.aspx
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • RH9 Webhelp Search function is not working properly

    Hi,
    My organization is using RH9 for a Webhelp project.  My company and our client are restricted to using IE9 for the online help I have created for this project, and our OS environment is Windows 7.  When I generate using the Webhelp layout, with the TOC, Index and Search options chosen, my resulting browser window shows two frames.  Left for the Contents/Index/Search and right for the content.  In the left panel, there are three links at the top for Contents, Index and Search.  When I click on the Search link, the only thing I see is the alphabet A-Z (which are links to filter items beginning with these letters (much like the index link) and a list of what I would say is garbage.  For example, if I click on H, I see items like "half 1 2 3" or "held" or "honor # 1 2 3 4 5 6 7 8", etc.  If I run my cursor down this list, I notice that maybe the word honor is a link.  If clicked it brings up one of my topic pages.  I can also click on the random numbers that appear, like clicking on 3 it brings up another topic page.  The search function does not allow me to type in a search criteria, since there is no search field as well.
    Do you have any suggestions for this issue?  Is this a bug, or do I need to change settings somewhere within RH9?  The same thing is happening when using this help project that is running on our clients server.  Is there any suggestion you can give to try and make this work properly?

    Rick,  Thanks for stepping in.    I assumed that was the reason why I was not receiving the search field, and that is fine for now.  We have discussed with our client the possibility of having two different help projects one for each, but that decision was kind of put on the back burner.
    However, the other issue I am having is still there and I don't quite understand why.  Since I only have clickable A-Zs for the search, and it lists links much like the Index section, I'm still seeing lists of just numbers and characters (i.e., "# 1 2 3 4 5", or "%" or "& 1 2 3 4 5" sometimes all the way up to 18 or so).  And each of these characters or numbers are clickable links as well to either page that doesn't contain that number or to nothing.
    Doing a bit more research, I have noticed that a lot of these links are being picked up by the PDF file we have as part of the project.  Our help project has a link to the documented version of the help in the form of a User Guide.pdf file.  So the search is listing items from that guide like the heading numbers 1.0, 1.0.1, etc.  Also each of these are clickable links that go nowhere.  But then there is still the numbers 1, 2, etc that go to pages that don't have this anywhere on the page.
    Do you have any insight as to why these types of things are being listed under Search at all?  They make that selection look very messy and unorganized.  Not professional at all.  I have checked and tested the properties settings and can't seem to find what is causing this to happen.  Any idea would be most appreciated!!

Maybe you are looking for

  • What are the tables storing data of tcode FB60

    Hi Friends Can anybody tell me in which tables transaction data for transaction code FB60 are stored. Thanks for your support. Regards KTK

  • Message Mapping- Source text view not working

    HI friends, in my idoc to file , in message mapping testing (static testing), i given values for sourse message and i executed test and the values are populating in target message.in target meesge if want to view of xml using source text view then..

  • Cannot open pdf's from internet

    I installed Adobe reader but found it wasn't necessary. After uninstalling it I cannot open pdf's from the internet. When I try all that opens is a blank screen. How can I fix this?

  • FCSS1 and Leopard - apple supported!

    Contrary to an earlier post by someone, if you look at http://docs.info.apple.com/article.html?artnum=307092 it is clearly stated that whilst FCP 4 (and earlier) is not supported FCS1 and FCS2 are! Final Cut Pro 4: Not supported on Mac OS X 10.5 Leop

  • Creating cart for free downloads?

    Greetings! I work at a university, and we have created an afterschool curriculum that we wish to offer to 4H, afterschool facilitators and teachers. The files are free for people to use, however we would like for people to complete a form before they