9 Replies Latest reply: Sep 9, 2007 1:49 PM by oicram RSS

    Making Advanced Search in Dreamweaver

    oicram Community Member
      I have a database where users need to put data with homeless dogs.
      In that "Insert Page" the user put the Height of the dog in centimeters. (i.e. 80).

      Now, in the "Search Dog Page" I want them to search by "Medium" "Big" "Small" where "Medium" "Big" "Small" corresponds a interval of values (always the same).

      How can I accomplish this?

      Can I use:

      SELECT height BETWEEN '0' AND '30' AS smallsize
      FROM blabla
      HAVING smallsize LIKE somesqlvariable

      and this somesqlvariable correspond to $_POST['dropdownsize']

      But how can we put the other sizes?

      OR,
      If I try to do this in the application side:

      I will need an IF instruction like this:

      if ($_POST["tamanho"] == "pequeno") {
      $varintervalo = "alt_cm_an < 30";
      } else if ($_POST["tamanho"] == "medio") {
      $varintervalo = "alt_cm_an >= 30 AND size < 40";
      } else if ($_POST["tamanho"] == "grande") {
      $varintervalo = "alt_cm_an >= 40";
      }

      and this:

      SELECT * FROM dogs WHERE $intervalo

      And this:
      Combo Box
      <select id="tamanho" name="Tamanho" >
      <option> pequeno </option>
      <option> medio</option>
      <option> grande </option>
      </select>


      But if I put this in dreamweaver, I get exclamation marks ! in my Server Behaviors panel or simple I don't see my Recordset !!
      And I have no clue where to put the IF statement in the code without getting errors from dreamweaver.







      So far here is my first TRY:
      ::::::::::::::::::::::::::::::::::::::::::::::::::::::::BEGIN::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::

      <?php
      (...)
      $vartipo_rs_procurar_animais = "-1";
      if (isset($_POST['tipo'])) {
      $vartipo_rs_procurar_animais = $_POST['tipo'];
      }
      $varintervalo_rs_procurar_animais = "-1";
      if (isset($_POST['tamanho'])) {
      $varintervalo_rs_procurar_animais = $_POST['tamanho'];
      }
      $varestado_rs_procurar_animais = "-1";
      if (isset($_POST['estado'])) {
      $varestado_rs_procurar_animais = $_POST['estado'];
      }
      $varsexo_rs_procurar_animais = "-1";
      if (isset($_POST['sexo'])) {
      $varsexo_rs_procurar_animais = $_POST['sexo'];
      }
      mysql_select_db($database_conn_db_cantinho, $conn_db_cantinho);

      if ($_POST["tamanho"] == "pequeno") {
      $varintervalo_rs_procurar_animais = "alt_cm_an < 30";
      } else if ($_POST["tamanho"] == "medio") {
      $varintervalo_rs_procurar_animais = "alt_cm_an >= 30 AND size < 40";
      } else if ($_POST["tamanho"] == "grande") {
      $varintervalo_rs_procurar_animais = "alt_cm_an >= 40";
      }

      $query_rs_procurar_animais = sprintf("SELECT CURDATE(), (YEAR(CURDATE())-YEAR(data_nasc_an)) - (RIGHT(CURDATE(),5)<RIGHT(data_nasc_an,5)) AS idade, id_an, tipo_an, nome_pt_an, sexo_pt_an, est_animal, alt_cm_an FROM animal WHERE %s AND tipo_an LIKE %s AND sexo_pt_an LIKE %s AND est_animal LIKE %s", GetSQLValueString($varintervalo_rs_procurar_animais, "text"),GetSQLValueString($vartipo_rs_procurar_animais, "text"),GetSQLValueString($varsexo_rs_procurar_animais, "text"),GetSQLValueString($varestado_rs_procurar_animais, "text"));
      $query_limit_rs_procurar_animais = sprintf("%s LIMIT %d, %d", $query_rs_procurar_animais,
      (...)
      ?>


      <body>
      <form id="procurar_animal" name="procurar_animal" method="post" action="<?php $_SERVER['PHP_SELF']; ?>">
      <label>Nome:
      <input type="text" name="Nome" id="Nome" />
      Tipo:
      <select name="tipo" id="tipo">
      <option value="cao" <?php if($_POST['tipo'] == "cao") echo "selected"; ?>>Cão</option>
      <option value="gato" <?php if($_POST['tipo'] == "gato") echo "selected"; ?>>Gato</option>
      <option value="outro" <?php if($_POST['tipo'] == "outro") echo "selected"; ?>>Outro</option>
      </select>
      </label>
      <label>Estado:
      <select name="estado" id="estado">
      <option value="%" <?php if($_POST['estado'] == "%") echo "selected"; ?> >Qualquer</option>
      <option value="nao adoptado" <?php if($_POST['estado'] == "nao adoptado") echo "selected"; ?> >Não Adoptado</option>
      <option value="adoptado" <?php if($_POST['estado'] == "adoptado") echo "selected"; ?> >Adoptado</option>
      <option value="reservado" <?php if($_POST['estado'] == "reservado") echo "selected"; ?> >Reservado</option>
      <option value="desaparecido" <?php if($_POST['estado'] == "desaparecido") echo "selected"; ?> >Desaparecido</option>
      <option value="falecido" <?php if($_POST['estado'] == "falecido") echo "selected"; ?> >Falecido</option>
      </select>
      Sexo:
      <select name="sexo" id="sexo">
      <option value="%" <?php if($_POST['%'] == "%") echo "selected"; ?> >Qualquer</option>
      <option value="masculino" <?php if($_POST['sexo'] == "masculino") echo "selected"; ?> >Masculino</option>
      <option value="feminino" <?php if($_POST['sexo'] == "feminino") echo "selected"; ?> > Feminino</option>
      </select>
      </label>
      <label>Idade:
      <select name="idade" id="idade">
      <option>Qualquer</option>
      <option>Bebé</option>
      <option>Jovem</option>
      <option>Adulto</option>
      <option>Velhote</option>
      </select>
      </label>
      <label>Tamanho:
      <select name="tamanho" id="tamanho">
      <option value="%">Qualquer</option>
      <option value="varintervalo_rs_procurar_animais < 30">Pequeno</option>
      <option value="varintervalo_rs_procurar_animais >= 30 AND varintervalo_rs_procurar_animais < 40">Médio</option>
      <option value="varintervalo_rs_procurar_animais > 40">Grande</option>
      </select>
      <br />
      <br />
      </label>
      <label></label>
      <input type="submit" name="pesquisa" id="pesquisa" value="Pesquisar" />
      </form>



      <table border="1">
      <tr>
      <td>ID</td>
      <td>Tipo</td>
      <td>Nome</td>
      <td>Sexo</td>
      <td>Idade</td>
      <td>Tamanho</td>
      </tr>
      <?php do { ?>
      <tr>
      <td><?php echo $row_rs_procurar_animais['id_an']; ?></td>
      <td><?php echo $row_rs_procurar_animais['tipo_an']; ?></td>
      <td><?php echo $row_rs_procurar_animais['nome_pt_an']; ?></td>
      <td><?php echo $row_rs_procurar_animais['sexo_pt_an']; ?></td>
      </tr>
      <?php } while ($row_rs_procurar_animais = mysql_fetch_assoc($rs_procurar_animais)); ?>
      </table>
      <?php } // Show if recordset not empty ?>
      </body>
      </html>
      <?php
      mysql_free_result($rs_procurar_animais);
      ?>
      ::::::::::::::::::::::::::::::::::::::::::::::::::::::::END::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::

      Hope you can help me with this.
        • 1. Re: Making Advanced Search in Dreamweaver
          Newsgroup_User Community Member
          oicram wrote:
          > I have a database where users need to put data with homeless dogs.
          > In that "Insert Page" the user put the Height of the dog in centimeters. (i.e.
          > 80).
          >
          > Now, in the "Search Dog Page" I want them to search by "Medium" "Big" "Small"
          > where "Medium" "Big" "Small" corresponds a interval of values (always the same).
          >
          > How can I accomplish this?

          In your drop-down menu to search for "small", "medium", and "large", set
          the values as a comma-separated string like this:

          <select name="size" id="size">
          <option value="1,30">Small</option>
          <option value="31,40">Medium</option>
          <option value="41,500">Large</option>
          </select>

          Yes, I know that you won't have 5-metre tall dogs. The final number
          simply needs to be above the maximum possible.

          Use the Advanced Recordset dialog box to create a SQL query like this:

          SELECT * FROM dogs WHERE size BETWEEN var1 AND var2

          In the Variables definition, set the Type of var1 to Numeric, and its
          Runtime value to $min; set the Type of var2 to Numeric, and its Runtime
          value to $max.

          Just above the code that sets the values of var1 and var2, insert this:

          if (isset($_POST['size'])) {
          $temp = explode(',', $_POST['size']);
          $min = $temp[0];
          $max = $temp[1];
          }

          --
          David Powers, Adobe Community Expert
          Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
          Author, "PHP Solutions" (friends of ED)
          http://foundationphp.com/
          • 2. Re: Making Advanced Search in Dreamweaver
            oicram Community Member
            I will test because now my code is a little bit different and I thouth that I was getting there:

            my new code page that does not work but that I think it was getting closer:

            <?php
            error_reporting(E_ALL); //comando porreiro para mostrar os erros que são dados no .php

            if (!function_exists("GetSQLValueString")) {
            function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
            {
            $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_rs_procurar_animais = 10;
            $pageNum_rs_procurar_animais = 0;
            if (isset($_GET['pageNum_rs_procurar_animais'])) {
            $pageNum_rs_procurar_animais = $_GET['pageNum_rs_procurar_animais'];
            }
            $startRow_rs_procurar_animais = $pageNum_rs_procurar_animais * $maxRows_rs_procurar_animais;


            $vartamanho_rs_procurar_animais = "-1";
            if (isset($_POST['tamanho'])) {

            if ($_POST['tamanho'] == 'pequeno') {
            $vartamanho_rs_procurar_animais = "alt_cm_an < 30";
            } else if ($_POST['tamanho'] == 'medio') {
            $vartamanho_rs_procurar_animais = "alt_cm_an >= 30 AND alt_cm_an < 40";
            } else if ($_POST['tamanho'] == 'grande') {
            $vartamanho_rs_procurar_animais = "alt_cm_an >= 40";
            }
            }

            $vartipo_rs_procurar_animais = "-1";
            if (isset($_POST['tipo'])) {
            $vartipo_rs_procurar_animais = $_POST['tipo'];
            }
            $varsexo_rs_procurar_animais = "-1";
            if (isset($_POST['sexo'])) {
            $varsexo_rs_procurar_animais = $_POST['sexo'];
            }
            $varestado_rs_procurar_animais = "-1";
            if (isset($_POST['estado'])) {
            $varestado_rs_procurar_animais = $_POST['estado'];
            }
            mysql_select_db($database_conn_db_cantinho, $conn_db_cantinho);
            $query_rs_procurar_animais = sprintf("SELECT CURDATE(), (YEAR(CURDATE())-YEAR(data_nasc_an)) - (RIGHT(CURDATE(),5)<RIGHT(data_nasc_an,5)) AS idade, id_an, tipo_an, nome_pt_an, sexo_pt_an, est_animal, alt_cm_an FROM animal WHERE %s AND tipo_an LIKE %s AND sexo_pt_an LIKE %s AND est_animal LIKE %s", GetSQLValueString($vartamanho_rs_procurar_animais, "text"),GetSQLValueString($vartipo_rs_procurar_animais, "text"),GetSQLValueString($varsexo_rs_procurar_animais, "text"),GetSQLValueString($varestado_rs_procurar_animais, "text"));
            $rs_procurar_animais = mysql_query($query_rs_procurar_animais, $conn_db_cantinho) or die(mysql_error());
            $row_rs_procurar_animais = mysql_fetch_assoc($rs_procurar_animais);
            $totalRows_rs_procurar_animais = mysql_num_rows($rs_procurar_animais);
            ?>
            <!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>Encontrar Aninal</title>
            </head>

            <body>
            <form id="procurar_animal" name="procurar_animal" method="post" action="<?php $_SERVER['PHP_SELF']; ?>">
            <label>Nome:
            <input type="text" name="Nome" id="Nome" />
            Tipo:
            <select name="tipo" id="tipo">
            <option value="cao" <?php if($_POST['tipo'] == "cao") echo "selected"; ?>>Cão</option>
            <option value="gato" <?php if($_POST['tipo'] == "gato") echo "selected"; ?>>Gato</option>
            <option value="outro" <?php if($_POST['tipo'] == "outro") echo "selected"; ?>>Outro</option>
            </select>
            </label>
            <label>Estado:
            <select name="estado" id="estado">
            <option value="%" <?php if($_POST['estado'] == "%") echo "selected"; ?> >Qualquer</option>
            <option value="nao adoptado" <?php if($_POST['estado'] == "nao adoptado") echo "selected"; ?> >Não Adoptado</option>
            <option value="adoptado" <?php if($_POST['estado'] == "adoptado") echo "selected"; ?> >Adoptado</option>
            <option value="reservado" <?php if($_POST['estado'] == "reservado") echo "selected"; ?> >Reservado</option>
            <option value="desaparecido" <?php if($_POST['estado'] == "desaparecido") echo "selected"; ?> >Desaparecido</option>
            <option value="falecido" <?php if($_POST['estado'] == "falecido") echo "selected"; ?> >Falecido</option>
            </select>
            Sexo:
            <select name="sexo" id="sexo">
            <option value="%" <?php if($_POST['sexo'] == "%") echo "selected"; ?> >Qualquer</option>
            <option value="masculino" <?php if($_POST['sexo'] == "masculino") echo "selected"; ?> >Masculino</option>
            <option value="feminino" <?php if($_POST['sexo'] == "feminino") echo "selected"; ?> > Feminino</option>
            </select>
            </label>
            <label>Idade:
            <select name="idade" id="idade">
            <option>Qualquer</option>
            <option>Bebé</option>
            <option>Jovem</option>
            <option>Adulto</option>
            <option>Velhote</option>
            </select>
            </label>
            <label>Tamanho:
            <select name="tamanho" id="tamanho">
            <option value="%">Qualquer</option>
            <option value="varintervalo_rs_procurar_animais < 30">Pequeno</option>
            <option value="varintervalo_rs_procurar_animais >= 30 AND varintervalo_rs_procurar_animais < 40">Médio</option>
            <option value="varintervalo_rs_procurar_animais > 40">Grande</option>
            </select>
            <br />
            <br />
            </label>
            <label></label>
            <input type="submit" name="pesquisa" id="pesquisa" value="Pesquisar" />
            </form>

            <p>
            <?php if (array_key_exists('pesquisa', $_POST) && $totalRows_rs_procurar_animais == 0) { // Show if recordset empty ?>
            Não foi encontrado nenhum animal com os critérios definidos.
            <?php } // Show if recordset empty ?>
            </p>

            <?php if ($totalRows_rs_procurar_animais > 0) { // Show if recordset not empty ?>
            <table border="1">
            <tr>
            <td>ID</td>
            <td>Tipo</td>
            <td>Nome</td>
            <td>Sexo</td>
            <td>Idade</td>
            <td>Tamanho</td>
            </tr>
            <?php do { ?>
            <tr>
            <td><?php echo $row_rs_procurar_animais['id_an']; ?></td>
            <td><?php echo $row_rs_procurar_animais['tipo_an']; ?></td>
            <td><?php echo $row_rs_procurar_animais['nome_pt_an']; ?></td>
            <td><?php echo $row_rs_procurar_animais['sexo_pt_an']; ?></td>
            </tr>
            <?php } while ($row_rs_procurar_animais = mysql_fetch_assoc($rs_procurar_animais)); ?>
            </table>
            <?php } // Show if recordset not empty ?>
            </body>
            </html>
            <?php
            mysql_free_result($rs_procurar_animais);
            ?>


            To try the solution that you have provide me I have to change a little bit, I will reply as soon as possible.

            Thanks a lot.
            • 3. Making Advanced Search in Dreamweaver
              oicram Community Member
              I get this error:
              Notice: Undefined offset: 1 in /home/cantinho/www/www/admin/cantinho/encontrar_animal_V3.php on line 43

              the line 43 as this: $max = $temp[1];



              Here is the code:
              $maxRows_rs_procurar_animais = 10;
              $pageNum_rs_procurar_animais = 0;
              if (isset($_GET['pageNum_rs_procurar_animais'])) {
              $pageNum_rs_procurar_animais = $_GET['pageNum_rs_procurar_animais'];
              }
              $startRow_rs_procurar_animais = $pageNum_rs_procurar_animais * $maxRows_rs_procurar_animais;

              if (isset($_POST['tamanho'])) {
              $temp = explode(',', $_POST['tamanho']);
              $min = $temp[0];
              $max = $temp[1];
              }
              $varaltura1_rs_procurar_animais = "-1";
              if (isset($min)) {
              $varaltura1_rs_procurar_animais = $min;
              }
              $varaltura2_rs_procurar_animais = "-1";
              if (isset($max)) {
              $varaltura2_rs_procurar_animais = $max;
              }
              $vartipo_rs_procurar_animais = "-1";
              if (isset($_POST['tipo'])) {
              $vartipo_rs_procurar_animais = $_POST['tipo'];
              }
              $varestado_rs_procurar_animais = "-1";
              if (isset($_POST['estado'])) {
              $varestado_rs_procurar_animais = $_POST['estado'];
              }
              $varsexo_rs_procurar_animais = "-1";
              if (isset($_POST['sexo'])) {
              $varsexo_rs_procurar_animais = $_POST['sexo'];
              }
              mysql_select_db($database_conn_db_cantinho, $conn_db_cantinho);
              $query_rs_procurar_animais = sprintf("SELECT CURDATE(), (YEAR(CURDATE())-YEAR(data_nasc_an)) - (RIGHT(CURDATE(),5)<RIGHT(data_nasc_an,5)) AS idade, id_an, tipo_an, nome_pt_an, sexo_pt_an, est_animal, alt_cm_an FROM animal WHERE alt_cm_an BETWEEN %s AND %s AND tipo_an LIKE %s AND sexo_pt_an LIKE %s AND est_animal LIKE %s", GetSQLValueString($varaltura1_rs_procurar_animais, "int"),GetSQLValueString($varaltura2_rs_procurar_animais, "int"),GetSQLValueString($vartipo_rs_procurar_animais, "text"),GetSQLValueString($varsexo_rs_procurar_animais, "text"),GetSQLValueString($varestado_rs_procurar_animais, "text"));
              $query_limit_rs_procurar_animais = sprintf("%s LIMIT %d, %d", $query_rs_procurar_animais, $startRow_rs_procurar_animais, $maxRows_rs_procurar_animais);
              $rs_procurar_animais = mysql_query($query_limit_rs_procurar_animais, $conn_db_cantinho) or die(mysql_error());
              $row_rs_procurar_animais = mysql_fetch_assoc($rs_procurar_animais);

              if (isset($_GET['totalRows_rs_procurar_animais'])) {
              $totalRows_rs_procurar_animais = $_GET['totalRows_rs_procurar_animais'];
              } else {
              $all_rs_procurar_animais = mysql_query($query_rs_procurar_animais);
              $totalRows_rs_procurar_animais = mysql_num_rows($all_rs_procurar_animais);
              }
              $totalPages_rs_procurar_animais = ceil($totalRows_rs_procurar_animais/$maxRows_rs_procurar_animais)-1;
              ?>


              NOTE: "tamanho" is the name of my combo box.


              Thanks a lot for your help.
              • 4. Re: Making Advanced Search in Dreamweaver
                Newsgroup_User Community Member
                oicram wrote:
                > When I past the IF statement,
                > I get an exclamation mark in my recordset.
                > When I double click to see whats going on, I notice that the variables:
                > "varaltura1" and "varlatura2" lost ther Run-Time Value.

                The code is in the wrong order. Change this:

                > $varaltura1_rs_procurar_animais = "-1";
                > if (isset($min)) {
                > $varaltura1_rs_procurar_animais = $min;
                > }
                > $varaltura2_rs_procurar_animais = "-1";
                > if (isset($max)) {
                > $varaltura2_rs_procurar_animais = $max;
                > }
                > if (isset($_POST['size'])) {
                > $temp = explode(',', $_POST['size']);
                > $min = $temp[0];
                > $max = $temp[1];
                > }

                to this:

                if (isset($_POST['size'])) {
                $temp = explode(',', $_POST['size']);
                $min = $temp[0];
                $max = $temp[1];
                }

                $varaltura1_rs_procurar_animais = "-1";
                if (isset($min)) {
                $varaltura1_rs_procurar_animais = $min;
                }
                $varaltura2_rs_procurar_animais = "-1";
                if (isset($max)) {
                $varaltura2_rs_procurar_animais = $max;
                }


                --
                David Powers, Adobe Community Expert
                Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
                Author, "PHP Solutions" (friends of ED)
                http://foundationphp.com/
                • 5. Re: Making Advanced Search in Dreamweaver
                  oicram Community Member
                  I have done it (i have edited my last post) and I also have change the name 'size' in the code for 'tamanho' because that's the name of my combo box.

                  But even with this corrections I'm still getting the error after submiting the form:

                  Notice: Undefined offset: 1 in /home/cantinho/www/www/admin/cantinho/encontrar_animal_V3.php on line 43

                  line 43 I have this: $max = $temp[1];

                  Thanks for your help.

                  • 6. Re: Making Advanced Search in Dreamweaver
                    oicram Community Member
                    The code that you have give me works perfectly.

                    The problem is that I have another option in the combo box named: "Any"

                    So, in my drop-down values I have (translated) "Smal" ; "Medium" ; "Big" but also "Any".

                    When my drop-down is selected as "Any" I get the error:

                    Notice: Undefined offset: 1

                    With the others everythings fine.

                    A little help here please?

                    • 7. Re: Making Advanced Search in Dreamweaver
                      oicram Community Member
                      As a workaround I have change the values of my Any option in the drop-down to search between the minimal and the maximal absurd values:

                      <option value="1,500" <?php if(isset($_POST['tamanho']) && $_POST['tamanho'] == "1,500") echo 'selected="selected"'; ?>>Any</option>

                      But this will make unecessary work in the database. There is no better way to just tell him: If the option is Any ignore this field?


                      • 8. Re: Making Advanced Search in Dreamweaver
                        Newsgroup_User Community Member
                        oicram wrote:
                        > But this will make unecessary work in the database. There is no better way to
                        > just tell him: If the option is Any ignore this field?

                        Of course there is, but you said you don't want exclamation marks in the
                        Dreamweaver Server Behaviors panel.

                        Dreamweaver lets you generate the code rapidly for basic searches. If
                        you want something more advanced, you need to code it yourself, or to
                        adapt the Dreamweaver code. Once you have adapted it, you can no longer
                        use the Recordset dialog box to edit it.

                        The choice is yours: use Dreamweaver's built-in server behaviors as they
                        are, and be limited in what you can do, or adapt them, but be willing to
                        abandon the ability to edit them through the Server Behaviors panel.

                        --
                        David Powers, Adobe Community Expert
                        Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
                        Author, "PHP Solutions" (friends of ED)
                        http://foundationphp.com/
                        • 9. Re: Making Advanced Search in Dreamweaver
                          oicram Community Member
                          Thanks for your help. I guest there is never a perfect solution.

                          Now I will make another post, hope you can help me there to. The problem is similar but the equation more tricky.

                          In advanced search I will need have the ability to search by dogs Age.


                          I really really need to thank you, and tell you that, if everything goes well you are responsable for helping the life of abandoned dogs :)