Search Form Help

All:
Looking to see why this isn't spitting out the results...
there are no errors on the page.... so what am I missing?
<search.cfm>
<!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=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<cfform action="search-result.cfm" method="get">
<cfinput type="text" name="Search" size="20"
maxlength="20">
<cfinput type="submit" name="CompanyName"
value="Search">
</cfform>
</body>
</html>
Thanks to all,
M
<search-result.cfm>
<cfparam name="FORM.CompanyName" default="1">
<cfquery name="Search" datasource="NorthWind">
SELECT *
FROM Customers
WHERE CompanyName = '#FORM.CompanyName#'
ORDER BY CompanyName ASC
</cfquery>
<!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=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<strong><font size="6" color="#993300">Search
Results</font></strong>
<cfoutput
query="Search">#Search.CompanyName#</cfoutput>
</body>
</html>

you're using a GET method in your <form> tag. that will
pass values in the URL. the form scope will be empty.
FWIW, you also want to use form.search on the action page.
form.companyName is the name of your submit button. not the text
input field.

Similar Messages

  • Looking for help to develop data search form

    I have built a SQL Query that produces a data set of
    approximately 60,000 records which includes last_names,
    First_names, ID_numbers, Office_Names, Association_Names, and
    Member_Type fields. I have created a table that displays ten
    records at a time (in alphabetical order by last, first name). I
    want to (1) be able to search for a specific person in the dataset,
    and then once I find him/her, (2) be able to click on their
    ID_Number to select it and then go to another page with their
    ID_Number.
    I have not been able to find documentation on conducting
    searches of datasets. I am using classic ASP for server side
    scripting (though I am brand new at this).
    Any assistance you might be able to provide will be most
    gratefully appreciated.
    Thanks very much,
    Austin

    > Thank you Murray for your kind response. I am not
    entirely sure how to do
    > this. I suspect if I create a simple form with First and
    Last Name Fields
    > and
    > a Submit button and then POST the content of that form
    to a 'processor'
    > page
    > this is a good place to start???????
    That would surely work.
    > But I am not entirely sure how to insert those two items
    into the query on
    > the
    > processor page. Can you point me to any documentation or
    tutorial that
    > might
    > help me along with this?
    The search form posts its results to the processor page. The
    processor page
    retrieves those form values from the $_POST array, and uses
    them to
    formulate a new SQL SELECT statement, identical to the old
    one, except with
    the inclusion of the first and last name values from the
    $_POST array in the
    WHERE statement.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "AustinMoran" <[email protected]> wrote in
    message
    news:g914dr$rig$[email protected]..
    > Thank you Murray for your kind response. I am not
    entirely sure how to do
    > this. I suspect if I create a simple form with First and
    Last Name Fields
    > and
    > a Submit button and then POST the content of that form
    to a 'processor'
    > page
    > this is a good place to start???????
    >
    > But I am not entirely sure how to insert those two items
    into the query on
    > the
    > processor page. Can you point me to any documentation or
    tutorial that
    > might
    > help me along with this?
    >
    > I am sorry to be such a bother with this. I have a
    handful of books, but
    > none
    > of them touch on this and I am at a loss.
    >
    > Thanks again for your kind helpfulness.
    >
    > Austin
    >

  • My search form on the ff home page is disabled when i installed ver 4. help.

    When I installed ver 4, the main search form on ff's homepage was disabled. Please help.

    Not the ideal solution, but you can install IE Tab Plus, run it in Classic Mode, and add My MSN to the Sites Filter list. Inelegant, but it works.

  • Not Able to put LOV in search form fields

    Hi
    I created the search form using Bindvariables.In my application i am using only JSF,ADF BC,trindad components(In Mobile apps,we have to use only trinidad comp's).
    I want search fields as LOv's .
    In AppModule,under view,ExecuteWithParams i have bindvariables.while dragging them i selected the selectonechoice ,in Edit List Binding Window,for base datasource i am giving one VO,and for list Data Source i am giving different VO .
    everithing is fine.but when i click 'ok' Button,it is giving th efollowing error.
    The selected target attribute has read-only access.please select an updateable attribute
    what is the Wrong i am doing?
    PLease anyone help me in figuring out my problem?
    I want to make the search fields as LOV in search form.so that user no need to enter the data in to them.simply can select the value from LOVand find out the results .
    Sailaja.

    what actulay is the problem.. i triied it , this is working fine.
    I guess just in the lov you have made make both the fields updatable
    Edited by: Rohit Hoon on Apr 23, 2009 2:13 AM

  • How to get the SQL Query statement of a Search Form ?

    Hi all,
    We have a requirement to send the query result of an ADF Search Form into report application (Crystal rpt).
    Crystal can accept data source as query statement. SO I think of getting the exact query statement "generated" by the ADF Search form and send it to crystal.
    Is this possible ?
    Thank you very much,
    xtanto

    Try the various get methods of the viewObject such as getQuery:
    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.2/state/content/navId.4/navSetId._/vtAnchor.getQuery%28%29/vtTopicFile.bc4jjavadoc%7Crt%7Coracle%7Cjbo%7CViewObject%7Ehtml/

  • How to use Multiple Keywords in a Search Form?

    I'm currently using a bind variable on the view object to generate a search form where the user enters one keyword that is applied to the WHERE cause of the SQL query.
    The problem is I'm trying to implement a Google-type search, where the user can enter multiple keywords in a single text input area. I then want to parse out those keywords and search the database on each keyword (similar to a Google search.) Can someone please help me point me in the right direction as to where / how to code in the appropriate hooks to accomplish this?
    Example:
    (user input) Enter Search Keywords: keyword1 keyword2 keyword3.. keywordn
    database query:
    Select item from table where (desc like '%keyword1%') or .. (desc like '%keywordn%') or
    (category like '%keyword1%') or .. (category like '%keywordn%')

    Can't you parse what was entered and create a number of view criteria rows, then apply them? At that point, they would be 'OR'd together'.

  • Creating a search form based on a table.

    Hello,
    I'm currently trying to create a search form which performs a searchquery in values stored in a table in my database.
    The table is filled peoples names,lastnames ,telephonenumbers and departments.
    I can use the sample application to make a form based on the tableview but this returns a search textfield for every column in the table. I just want 1 searchfield/textfield to search on ALL columns at the same time and display the other fields as labels when returning the queryresults.
    I tried searching the forums for an explanation on how to build said form and I checked Metalink but I have yet to find one. Anyone out there willing to help me out?
    thanks in advance,
    Melvin K.

    Why not use an instr with your data in a bind variable in your where clause for the select?? Page 1 sets an item called P2_Parameter with your value string slightly modified ('12345','345632','645534534','3434344')
    Select a,b,c,d,e from some_table where INSTR(TO_CHAR(Lookup_column,'099999999'),:P2_Parameter)
    Maybe that will work? Its off the top of my head, but should get you what you want.. (But to agree with one of the other posters, it is a BAD Design..) I would try like an interactive report to allow them to enter in acct #'s or whatever these are and let them access the rows that way..
    Thank you,
    Tony Miller
    Webster, TX

  • How to create a search form? - Jdev TP4 11.1.1.0.0

    Hi,
    I am using Jdev TP4 11.1.1.0.0.
    I have a af:table which is based on a view. I want to have a search form on top of this af:table to query based on the selection in the search form. I have 15 columns in the view. When I drag and drop the "All queriable attributes" from the named criteria I get all these columns in the search form. I need only 3 of the columns in the search form and the af:table should query based on the selection. How can I achieve this? Any help. Thanks in advance.

    You can create a new named query with only these three columns in the where clause and use that.
    Or you can drag the VO as a search form and remove the columns you don't need.

  • SelectInputDate component in a search form - JDev 10.1.3.0.4

    Cheers to all of you buddies in this valley of tears, have a good day
    I have a table that contains a date column, and a search form to do "query by example" and its date field is a "selectInputDate" with its date chooser.
    The date column in the table is formatted as yyyy-MM-dd (assigned in the underlying BO).
    I assigned a "convertDateTime" with a pattern yyyy-MM-dd to the selectInputDate component.
    At this point, the page works correctly. I select a date and get the appropiate results.
    The problem rised when adding a validator to the "selectInputDate" component.
    I added a "validateDatatimeRange" validator and binded the Maximum and Minimum values to two java.util.Date fields (minDate and maxDate) defined in a session managed bean named depSessionBean. The binding was done using EL as #{depSessionBean.minDate} and #{depSessionBean.maxDate}. The effect is that the date chooser only enables dates within the range (good).
    The problem arises when I click on the "Execute" action button. All I get is a lovely error complaining about date conversions.
    The attached converter returns a String that is correctly used to query the data but the validator expects a java.util.Date (it does not accept String values).
    So, am I missing something? How can I get the converter and validator to work together?
    Thanks a heap for any help.
    A.Gurisatti
    This is the error I get when executing the query (2006-08-14 is the chosen date):
    500 Internal Server Error
    oracle.adfinternal.view.faces.convert.ConvertException: Could not convert instance:2006-08-14 of type:class java.lang.String into type:class java.util.Date
         at oracle.adfinternal.view.faces.convert.GenericConverterFactory.convert(GenericConverterFactory.java:189)
         at oracle.adfinternal.view.faces.validator.DateTimeRangeValidator.validate(DateTimeRangeValidator.java:27)
         at oracle.adf.view.faces.component.UIXEditableValue.validateValue(UIXEditableValue.java:378)
         at oracle.adf.view.faces.component.UIXEditableValue.validate(UIXEditableValue.java:206)
         at oracle.adf.view.faces.component.UIXEditableValue._executeValidate(UIXEditableValue.java:522)
         at oracle.adf.view.faces.component.UIXEditableValue.processValidators(UIXEditableValue.java:302)
         at oracle.adf.view.faces.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:855)
         at oracle.adf.view.faces.component.UIXComponentBase.validateChildren(UIXComponentBase.java:839)
         at oracle.adf.view.faces.component.UIXComponentBase.processValidators(UIXComponentBase.java:689)
         at oracle.adf.view.faces.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:855)
         at oracle.adf.view.faces.component.UIXComponentBase.validateChildren(UIXComponentBase.java:839)
         at oracle.adf.view.faces.component.UIXComponentBase.processValidators(UIXComponentBase.java:689)
         at javax.faces.component.UIForm.processValidators(UIForm.java:170)
         at oracle.adf.view.faces.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:855)
         at oracle.adf.view.faces.component.UIXComponentBase.validateChildren(UIXComponentBase.java:839)
         at oracle.adf.view.faces.component.UIXComponentBase.processValidators(UIXComponentBase.java:689)
         at oracle.adf.view.faces.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:855)
         at oracle.adf.view.faces.component.UIXComponentBase.validateChildren(UIXComponentBase.java:839)
         at oracle.adf.view.faces.component.UIXComponentBase.processValidators(UIXComponentBase.java:689)
         at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:912)
         at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:342)
         at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:78)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
         at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:332)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)

    Frank,
    Thanks for your reply and yes I'm using BC (I allways forget that important piece of information).
    Unfortunatelly I still have a few doubts:
    - I suppose that assigning a pattern to a date column in a BO is for display purposes and in some cases to have the right conversions in where clauses. In this case, choosing yyyy-MM-dd (that is the default) is a coincidence and in this case, you are right it is superfluous. But suppose we use dd/MM/yyyy. In this case, the date will be rendered with this new pattern. Even more, I suppose that in a query by example, when building the where clause, JDev expects the given date to be a string with that same pattern (dd/MM/yyyy). So, we have the first conclusion: The selected date must be a String with the given pattern. That is why I assigned a converter to the selectInputDate component.
    I did some tests and concluded: The patterns in the BO and in the converter assigned to the selectInputDate component must match or the query won't work.
    The second step is to narrow the date range. The way I found to do it is by assigning a datetime validator to the selectInputDate component. This validator expects java.util.Date values for its min and max dates, and the date chooser works well (by enabling only dates between the given range).
    The problem rises when you submit the form. At validation time you have: a date expressed as a formatted String (needed for the query) and a validator expecting a java.util.Date to perform the validation. So, you get a casting error.
    All this is what I understood and concluded about the situation and, of course I could be completelly wrong.
    If my steps for configuring the search parameters are correct, there must be a way to do the String - Date casting and avoid the error.
    If my approach is wrong then there must be a correct approach for this kind of situation.
    Thanks a lot for your help,
    A. Gurisatti

  • How can I show Search Form parameter values in URI of Results page?

    I have searched through these pages for posts relating to caching but haven't seen any that relate to my issue.
    We run a website that accesses data through search forms and returns matching data to the requester in a results page. The search criteria are entered in a form and the results page is generated by a servlet that gets the search parameter values that the user entered using the GET method.
    I would like rewrite this Search page using JDeveloper to bring our old code up to date and take advantage of new features that should help performance. In particular, I want to utilise the WebCache.
    To use the WebCache effectively, the cache needs to know what the search criteria were when it delivers a page so that repeated requests using the same criteria can be served directly from the cache.
    The data retrieved by a query may change from one search to to the next so I can't use time-based caching. But, I can use the WebCache Invalidation interface from the back-end DB server to flush old data out of the WebCache when it is changed, but to flush out the correct pages I need to know the parameter values passed.
    If I just follow the demos, it seems like the search parameters are all hidden in beans or something which means that the Web Cache can't be used for what I want. The parameter values are important.
    So my question is: is there a way of showing the search parameters used in the URI to the Results page? Can the old GET method of parameter passing be used (or can I somehow just put the old style parameters onto the URI?)
    Alternatively, is there a simple How To or Demo on how to use the Web Caching facility with JSF?
    (ADF Caching and Java Object caching do not seem appropriate for my needs. ADF caching seems to be limited to having fragments cached for fixed periods of time and Java Object caching is orders of magnitude slower and involves the Application Server.)
    Thanks for any advice,
    Andy

    Sorry - should have said I'm using JDev 10.1.3.0.4 with JSF & ADF BC.

  • Problems with custom search form in adf

    Hi,
    I am using JDeveloper 11.1.2.4. please can you help with this issue?
    I've created a custom search form with the help from this link.
    Jdeveloper,Oracle ADF &amp;amp; Java: Implementing custom search form in ADF programmatically (Without using af:query)
    I've created two bind variables SkuBind & ImperfectBind and a View Criteria.
    My problem is when I press Search button, it does not filter based on values of the bind variables in the View Criteria.
    I rightly get bind variable values in the System output though
    Skubind = 1000
    Imperfectbind = N
    but there is no where clause
    where clause = null
    public void SearchOddShoes(ActionEvent actionEvent) {
    AppModuleImpl am = (AppModuleImpl)resolvElDC("AppModuleDataControl");
    ViewObject oddShoeVo = am.getRtnOddShoesVO1();
    oddShoeVo.setNamedWhereClauseParam("SkuBind", skuPgBind.getValue());
    oddShoeVo.setNamedWhereClauseParam("ImperfectBind", imperfectPgBind.getValue());
    System.out.print("Named Skubind = " + oddShoeVo.getNamedWhereClauseParam("SkuBind") +"\n");
    System.out.print("Named Imperfectbind = " + oddShoeVo.getNamedWhereClauseParam("ImperfectBind") +"\n");
    System.out.print("where clause = " + oddShoeVo.getWhereClause()+"\n");
    System.out.print("where clause params= " + oddShoeVo.getWhereClauseParams()+"\n");
    System.out.print("Sql is " + oddShoeVo.getQuery()+"\n");
    oddShoeVo.executeQuery();
    public Object resolvElDC(String data) {
               FacesContext fc = FacesContext.getCurrentInstance();
               Application app = fc.getApplication();
               ExpressionFactory elFactory = app.getExpressionFactory();
               ELContext elContext = fc.getELContext();
               ValueExpression valueExp =
                       elFactory.createValueExpression(elContext, "#{data." + data + ".dataProvider}", Object.class);
               return valueExp.getValue(elContext);
    thanks

    Not clear what part of the code doesn't work. Assuming that you did check that the code you wrote executed
    the problem may be the following.
    You need to add partial trigger on the destination component.
    Add ...
    oddShoeVo.executeQuery();
    AdfFacesContext.getCurrentInstance().addPartialTarget(HERE_THE_BIND_NAME_OF_YOUR_TABLE);
    Also I don't see that you acctually use View Criteria. There are specific way to apply View Criteria programatically and I don't see that you use it.
    The simpliest way is just to change the VO query to embed bind variables into the query
    E.G.
    select 1
    from dual
    where some_column= :P_PARAM1

  • 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);
    ?>

  • Problem with search forms in master-detail structure

    According to JHeadstart error message i cant generate 2 search forms in one page, BUT i generated master table in one page and master form + detail table in another so WHY i cant put search forms for both tables?? They are on the different pages!
    How can i solve this problem?

    Sasha,
    The reason this is not allowed, is because when you use Layout Style table-form, the same UImodel is used for both the table and the form page, and each UImodel can have only one advancedSearch binding (which is also used for quick search). Each advancedSearch binding can be linked to only one iterator, and that is either the iterator of the master table or the iterator of the detail table.
    An enhancement request to remove this limitation is high on our wish-list, but didn't make it in the 10.1.2.1 release.
    You could try to make post-gen modifications to add an extra search. I have not tried it, but here is what I would do:
    - generate with search for master, and backup the generated pages and ui model
    - generate with search for detail, and backup the generated pages and ui model
    - merge the pages and ui models, renaming one of the advancedSearch bindings
    - for the page where the renamed binding should be use, make a subclass of JhsDataAction and override onQuickSearch and/or onAdvancedSearch, to use the other binding name
    Hope this helps,
    Sandra Muller
    JHeadstart Team
    Oracle Consulting

  • Creating a Better Search Form

    Hi,
    I'm trying to figure out how to create a dynamic search form
    using Coldfusion 8.
    Right now if I enter multiple words in my search field the
    results omit certain records. For example, if I put "toy blue" in
    the search field it will return results that only have "TOY BLUE"
    together and omits any records that only have "TOY" or only have
    "Blue" in the column being searched.
    Is there a way to add the following abilities to my basic
    search code located at the bottom of my post:
    - Search multiple words that are entered in the criteria
    input field.
    - The words can be separated by commas, spaces, or the word
    "and".
    - Have it so you can search multiple word phrases by using
    quotes.
    <!--- Search Form--->
    <form name="myForm" method="post"
    action="results.cfm">
    <p>
    <input name="criteria" type="text" id="criteria">
    <input type="submit" name="Submit" value="Submit">
    </p>
    </form>
    <!--- Results Page --->
    <cfquery name="qSearch" datasource="myDatabase"
    dbtype="ODBC">
    SELECT itemID, itemName
    FROM myTable
    WHERE 1 = 1
    <cfif IsDefined("form.criteria") AND
    Len(Trim(form.criteria))>
    and (itemName LIKE '%#form.criteria#%' or itemDescription
    LIKE '%#form.criteria#%')
    </cfif>
    </cfquery>
    <p><b>Results:</b></p>
    <cfoutput query="qSearch">
    <p>#itemid# - #itemName#</p>
    </cfoutput>
    <!--------->
    Any help would be greatly appreciated.
    Thanks
    -C

    This is the relevent sql
    and (itemName LIKE '%#form.criteria#%' or itemDescription
    LIKE '%#form.criteria#%')
    substituting the variable, it looks like this
    and (itemName LIKE '%TOY BLUE%' or itemDescription LIKE '%TOY
    BLUE%')
    You have to treat form.criteria as a list, and loop through
    it.

  • Simple Search Form

    I am having a really annoying problem with my single field search form. When I search for results I want it to load a page with a form with all the fields filled in.
    I have this method working on another page.
    The form is on member_search.php and the form field is name 'mid'. I have the form action set to member_search2.php which has the complete member profile form on it.
    I have a recordet on member_search2.php with the filter is mid = form varriable mid and have all the fields dynamic.
    But when I search it loads the member_search2.php with all fields blank.
    Any help is wonderful!
    Thanks,
    Nicole

    What is your form Method set to? If it's set to POST, form variable is correct, but if it's set to GET, you should use URL parameter as your filter.

Maybe you are looking for