Need to view all records with two variables in recordset

Hi - My recordset has two variables used to sort products by popularity and type.  But I want a "View all" link that shows all records, in ascending order, regardless of popularity or type.  At the moment the .php page is set up to receive either the popularity (varPopular) variable or the product type variable (varGrouping).  If neither variable is provided, no products appear on screen.  How do I set up the recordset to allow for all records to be displayed?  Thanks for your help!
[CODE]
$varPopular_Recordset1 = "n";
if (isset($_GET[popular])) {
  $varPopular_Recordset1 = $_GET[popular];
$varGrouping_Recordset1 = "1";
if (isset($_GET[grouping])) {
  $varGrouping_Recordset1 = $_GET[grouping];
mysql_select_db($database_connGiavan, $connGiavan);
$query_Recordset1 = sprintf("SELECT crystal_colors.cystalid, crystal_colors.displayname, crystal_colors.imagename, crystal_colors.popular, crystal_colors.`grouping` FROM crystal_colors WHERE crystal_colors.popular=%s OR crystal_colors.grouping=%s", GetSQLValueString($varPopular_Recordset1, "text"),GetSQLValueString($varGrouping_Recordset1, "int"));
$Recordset1 = mysql_query($query_Recordset1, $connGiavan) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$varGrouping_Recordset1 = "$_GET[grouping]";
if (isset($_GET[grouping])) {
  $varGrouping_Recordset1 = $_GET[grouping];
$varPopular_Recordset1 = "$_GET[popular]";
if (isset($_GET[popular])) {
  $varPopular_Recordset1 = $_GET[popular];
mysql_select_db($database_connGiavan, $connGiavan);
$query_Recordset1 = sprintf("SELECT crystal_colors.cystalid, crystal_colors.displayname, crystal_colors.imagename, crystal_colors.popular, crystal_colors.`grouping` FROM crystal_colors WHERE crystal_colors.popular=%s OR crystal_colors.grouping=%s", GetSQLValueString($varPopular_Recordset1, "text"),GetSQLValueString($varGrouping_Recordset1, "int"));
$Recordset1 = mysql_query($query_Recordset1, $connGiavan) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
[Moved to Dreamweaver Application Development forum by moderator]

To start with, you should be aware of the fact that you have the same recordset code twice in your page.
You'll find an article that explains how to build a SQL query to do what you want here: http://cookbooks.adobe.com/post_Create_search_query_with_optional_fields-16245.html.

Similar Messages

  • For All Entries with two tables

    Hi All,
             Can we use FOR ALL ENTRIES with two tables. for example
    SELECT * FROM MKPF INTO TABLE T_MKPF
             WHERE BUDAT IN S_BUDAT.
    SELECT * FROM MARA INTO TABLE T_MARA
             WHERE MTART IN S_MTART AND
                            MAKTL IN S_MAKTL.
    SELECT * FROM MSEG INTO TABLE T_MSEG
           FOR ALL ENTRIES IN  "T_MKPF AND T_MARA"
                  WHERE MBLNR EQ T_MKPF-MBLNR AND
                                 MATNR EQ T_MARA-MATNR.
    can we do it like this or any other way to do this plz tell. I waitting for your responce.
    Thanks
    Jitendra

    Hi,
    u cannot do like this....chek some documentation on it..
    1. duplicate rows are automatically removed
    2. if the itab used in the clause is empty , all the rows in the source table will be selected .
    3. performance degradation when using the clause on big tables.
    Say for example you have the following abap code:
    Select * from mara
    For all entries in itab
    Where matnr = itab-matnr.
    If the actual source of the material list (represented here by itab) is actually another database table, like:
    select matnr from mseg
    into corresponding fields of table itab
    where ….
    Then you could have used one sql statement that joins both tables.
    Select t1.*
    From mara t1, mseg t2
    Where t1.matnr = t2.matnr
    And T2…..
    So what are the drawbacks of using the "for all entires" instead of a join ?
    At run time , in order to fulfill the "for all entries " request, the abap engine will generate several sql statements (for detailed information on this refer to note 48230). Regardless of which method the engine uses (union all, "or" or "in" predicates) If the itab is bigger then a few records, the abap engine will break the itab into parts, and rerun an sql statement several times in a loop. This rerun of the same sql statement , each time with different host values, is a source of resource waste because it may lead to re-reading of data pages.
    returing to the above example , lets say that our itab contains 500 records and that the abap engine will be forced to run the following sql statement 50 times with a list of 10 values each time.
    Select * from mara
    Where matnr in ( ...)
    Db2 will be able to perform this sql statement cheaply all 50 times, using one of sap standard indexes that contain the matnr column. But in actuality, if you consider the wider picture (all 50 executions of the statement), you will see that some of the data pages, especially the root and middle-tire index pages have been re-read each execution.
    Even though db2 has mechanisms like buffer pools and sequential detection to try to minimize the i/o cost of such cases, those mechanisms can only minimize the actual i/o operations , not the cpu cost of re-reading them once they are in memory. Had you coded the join, db2 would have known that you actually need 500 rows from mara, it would have been able to use other access methods, and potentially consume less getpages i/o and cpu.
    In other words , when you use the "for all entries " clause instead of coding a join , you are depriving the database of important information needed to select the best access path for your application. Moreover, you are depriving your DBA of the same vital information. When the DBA monitors & tunes the system, he (or she) is less likely to recognize this kind of resource waste. The DBA will see a simple statement that uses an index , he is less likely to realize that this statement is executed in a loop unnecessarily.
    Beore using the "for all entries" clause and to evaluate the use of database views as a means to:
    a. simplify sql
    b. simplify abap code
    c. get around open sql limitations.
    check the links
    http://www.thespot4sap.com/articles/SAPABAPPerformanceTuning_ForAllEntries.asp
    The specified item was not found.
    Regards,
    Nagaraj

  • Is it possible to view all record of child object in parent detail page.

    Hi All,
    Could someone please tell me how to view all records of child object in any associated parent detail page.
    For example, In opportunity detail page I want to see all lead associated with particular opportunity. As per standard setting I can be able to see only five lead records in opportunity detail page. Is it possible to view all lead on the same opportunity detail page instead of clicking on "show full list"
    Thanks in advance.
    Manish

    There is my code in labVIEW for the moment
    See attachments
    Dany
    Dany Allard
    Attachments:
    Exemple code SET.JPG ‏47 KB

  • Can't View All Records if Max Row Count is null

    Hi,
    There are over 2500 records in a table and if Max Row Count is set to nothing in report attributes, the user is restricted to view only 500 records. And If Max Row Count is set more than 2500 then user is able to view all records but taking more time to display report.
    What to do to minimise process time and allow user to view all the records. ?
    Pagination Scheme : Row Ranges X to Y of Z (with pagination)
    Number of Rows : 100
    Number of Rows (Item) :     <empty>
    Max Row Count :           <empty>
    Thanks,
    Ven.

    Hi Ven,
    Apex restricts the number of rows returned by a report to 500 by default. You can change this by setting the Max Row Count. Apex does this so that the amount of data returned over the network to the browser is kept to a reasonable amount. The reason it is done this way is because a user in apex does not maintain a stateful connection to the database and as a result, rows returned from a query can not be cached in the database and fetched as required.
    From a usability point of view, I'm not sure why a user would want 2500+ rows returned to a screen. They would have to scroll and paginate to find anything of use and network bandwidth would get chewed up in the process. Why not provide the users with query options so that the number rows returned to the browser is restricted to a more manageable amount? If the users require a full hardcopy of the data then you can handle this with csv and pdf options.
    Regards
    Andre

  • Calculation of interest amount with two variables formula

    Hello everyone,
    Iu2019m facing a problem with the way that TRM calculate the interest amount for money market transaction when I have a formula with two variable, e.g. reference interest rate u201CXu201D multiplied by 0,98.
    Some contracts explicitly say that to obtain the u201Cdaily interest rateu201D of the contract firstly the u201Cdaily interest rateu201D of the reference interest rate must be calculated and then apply a index or factor (e.g. 0,98). In the other hand some contracts says that it should be done the other way around. Iu2019ve noticed that TRM calculate the interest amount using the first way.
    Is there any way to set which the way the interest amount should be calculates?
    Has anyone faced similar problem?
    The examples below illustrate the difference in the two ways to calculate interest amount.
    Considering the following money market transaction:
    1. Borrowing structure:
    1.1. amount: USD 1.000.000,00
    1.2. flow type: 1105 u201CBorrowing/Increaseu201D
    2. Term (only one day to simplify the example)
    2.1. Start date: 30.01.2011
    2.2. End data:   31.01.2011
    3. Interest structure:
    3.1. Interest form: VARIABLE ( formula = Z1 * 0,98), where u201CZ1u201D is a reference interest rate
    3.2. condition type: 1200 u201CNominal interestu201D
    3.3. Interest calculation method: ActW/252
    Considering that Z1u2019s annual interest rate in 30.01.2011 is 11,66%, TRM would perform the following calculation:
    1. Contract annual interest rate (%) = Z1*0,98 = 11,66 *0,98 = 11,42680000%
    2. Convert from u201CContract annual interest rate (%)u201D  to number = 1,11426800
    3. u201CContract daily interest rateu201D = 1,11426800 ^(1/252) = 1,00042945
    4. Convert from u201Cnumberu201D to Day interest rate (%)  = 0,04294481%
    5. Interest amount = u201CContract daily interest rateu201D * Borrowed amount = 0,04294481% * 10.000.000,00 = 4.294,48
    In the other hand, some contracts say that the interest rate should be calculated in the following way:
    1. Annual interest rate (%) = 11,66  = 11,66000000%
    2. Convert from u201CAnnual interest rate (%)u201D  to number = 1,11660000
    3. Daily interest rate = 1,11660000 ^(1/252) = 1,00043775
    4. Convert from u201Cnumberu201D to Daily interest rate (%)  = 0,04377480%
    5. Calculate u201CContract daily interest rateu201D = 0,04377480% * 0,98 = 0,04289930%
    5. Interest amount = u201CContract daily interest rate (%)u201D  * Borrowed amount = 0,04289930% * 10.000.000,00 = 4.289,93
    With this simple scenario  we end up with a USD 4,55 difference for a single day, but for big contracts of hundred millions and for several years the difference is quite  huge.
    Thanks in advance ..
    Giuliano

    Hi,
    with Product Category 550 you can have both scenarios:
    for the 1st case you can use a formular (e.g. EONIA * 0,98)
    => interest for 1 day: 462,70 EUR
    for the 2nd case you can use the field Variable Interest Rate (EONIA) + field Payment Rate (98)
    => interest for 1 day: 453,44 EUR
    Is this, what you are looking for?
    Regards,
    Lorenz

  • I have a L7680 All in with two new print heads but the new cyan/magenta shows yellow monitor status.

    I have a L7680 All in with two new print heads but the new cyan/magenta shows yellow monitor status. Ink status, cyan more than 50% and magenta is a 25% w/no low ink warnings... Just ran a clean print head again, print out looks good now but the status of the new cyan/magenta shows yellow monitor status. Is it time to buy another..When I purchased this printer it had to be replaced 3 times because of problems... Just a lemon?
    thx for your help in advance...
    Jim

    Could you share a link to the page?
    Seeing it in context and in our browsers is much easier to debug.
    If not, make sure to run the validator here The W3C Markup Validation Service and clear out any problems. HTML errors, especially structural ones, will cause all kinds of display problems in various browsers/versions/platforms.

  • How can I view all images with Safari on my mac?

    how can I view all images with Safari on my mac? When I go to pinterest or any stock photo site I can only see some of the images on my mac.

    Please link to an example of a page you're having problems with. It should be accessible without a login.

  • How can I blur a image with two variables : degree and radius?

    how can I blur a image with two variables : degree and radius?
    a lot of thanks !

    What are the values of these variables supposed to represent?

  • How can I make a report of all records with the date in the last two weeks?

    Hi!
    I have records with a date field, I want to create a report that only includes records with a date which is within the last two weeks of the system date, is this possible? Surely this is a basic database function, I would have thought, but I can find no help about it and there's very little in Mac Help about doing anything other than simple stuff with reports.
    I'm not a genius with databases, so help with any required formula or what have you would be great!

    Hi Jonathan,
    Here's a formula you can use with the Match function. 'Date' is the name of the date field, which must be a "Date" type field.
    'Date'>NOW()-14
    Match will select (highlight) all records matching the query. You'll then need to use Organize > Hide Unselected to show only the matches.
    Unfortunately, I haven't found a way to make the NOW() function work in a Find request, and neither Match requests nor Hide Unselected can be included in a recorded search, either of which would reduce repeating the report to a one-button operation.
    Regards,
    Barry

  • I need help deleting "all records associated with my domain name"

    Hello,
    I'm having problemsthe same exact problem as Daren... setting up my site to go live. Here's what I've done so far:
    1) built the site and pushed it live
    2) upgraded the site
    3) set up a GoDaddy domain name
    4) set up the servers on GoDaddy
    5) set up the associate account info on BC
    And then.... nothing.
    I've then deleted the domain and tried to repeat the process, in case I missed something, but now I can't set up a new domaine and keep getting the error "Domain already exists. Please delete all records associated with this domain". What records? What does this even mean?
    Can someone please walk me through the steps to get this site live?
    Thanks!
    Alex

    Can you try again? If still no go, please reach out to BC support directly via http://helpx.adobe.com/contact.html?product=business-catalyst&topic=using-my-product-or-se rvice.
    Thanks,
    Vinayak

  • In MVC, do i need a View or Page with flow logic for POPUP window

    Hi All,
    I have the below scenario using the MVC pattern.
    I have a main view with 3 trays, each tray has two buttons, for example first tray has Create Order button. When I click on this button, I need a popup window to come with a tableview and a button(Create), where I select some rows and click on the button Create  to create order.
    But as per the MVC pattern I canu2019t call the view (popup) from another view(main view).  So should I create a VIEW or PAGE WITH FLOW LOGIC for the popup? .
    I need 6 popup to be called from the main view and once the function is done close the popup.
    Please suggest me the flow for this scenario.
    Cheers,
    Srini.

    Srini,
    1. You can call the view in pop-up because you will be calling the controller using open.window.
    Here is the sample code:
    method DO_REQUEST .
      data:
            li_vw           type ref to   if_bsp_page,
            lv_form_field   type          string,
            li_md           type ref to   zcl_model01.
      dispatch_input( ).
      li_md ?= get_model( 'm01' ).
      lv_form_field = request->get_form_field( 'invoice_create' ).
      if lv_form_field is initial.
    *------ Request to display main page
        li_vw = create_view( view_name = 'main.htm' ).
        li_vw->set_attribute( name = 'model' value = li_md ).
        call_view( li_vw ).
      elseif lv_form_field eq 'true'.
    *------ Request to display Invoice page in pop-up
        li_vw = create_view( view_name = 'invoice.htm' ).
        li_vw->set_attribute( name = 'model' value = li_md ).
        call_view( li_vw ).
      endif.
    endmethod.
    Layout:
          function do_Invoice()
          { var s=0; r=1; w=300; h=300; x=screen.width/2;
            x=x-w/2;
            var y=screen.height/4;
            y=y-h/2;
            popUp=window.open('main.do?invoice_create=true','win','width='+ w
            +',height='+ h +', left=' + x +',top='+ y +');
    Option2:
    Ofcourse you can't bind the model in page becos those are 2 different things. But all you need to do is access the model to get some value. To know how to access the model from Page w/flow logic look at [this link|Passing model reference to a page in a Popup].
    Raja
    Edited by: Raja Thangamani on Apr 14, 2009 11:22 AM

  • Label of attribute when used as View Criteria item with Bind Variable

    I've a VO attribute used in a named search with this requirement:
    The attribute provides has an optional View Criteria item that has a bind variable operand. The bind variable is in the WHERE clause. The attribute has an LOV. The choice list for the specified View Criteria item should display the label "Effective Release". However, in all other contexts, including the search results table and the dropdowns the user can optionally add in an advanced search, the label displayed for the attribute must say "Release".
    In other words, the default label for the attribute should be "Release" in all but one context - which is that when the dropdown list for the viewCriteria item using the bind variable is displayed, the label should say "Effective Release".
    Note that if the user moves to Advanced Search and selects adds the attribute as a search criteria, this latter usage should be labeled as "Release". (in this case, in other words, the dropdown that displays by default and has the bind variable operand is labelled "Effective Release", the one the user added in advance search is labelled "Release")
    here is the View Criteria item source xml:
          <ViewCriteriaItem
            Name="ReleaseId1"
            ViewAttribute="ReleaseId1"
            Operator="="
            Conjunction="AND"
            Value=":v_ReleaseId"
            GenerateIsNullClauseForBindVars="false"
            ValidateBindVars="true"
            IsBindVarValue="true"
            Required="Required"/>I've experimented by putting "Effective Release" as the label for the bind variable as below. However, ADF does not use that value to display, it defers to the attribute value:
    <Variable
        Name="v_ReleaseId"
        Kind="viewcriteria"
        Type="oracle.jbo.domain.Number">
        <Properties>
          <SchemaBasedProperties>
            <LABEL
              ResId="EFFECTIVE_RELEASE_LOV"/>
          </SchemaBasedProperties>
        </Properties>
      </Variable>The reason for the requirement, if it matters, is that the View Criteria item with the bind variable ("Effective Release" queries a range of values using the analytic function rank(); the bind variable is in the WHERE clause. Otherwise, the dropdown that can be added in advanced search ("Release") looks for exact matches on the attribute value. So since the search functionality is different, the label should be different.
    Am using 11g.
    Thanks for your help.

    Hi
    I have found that when using validation type Key Exists and the VO is in the local application, then the bind variable is available in the Create Validation wizard. When I try and create a validator on a VO that is core to all my applications, then I put that VO into an ADF library, the bind variable parameter is not available for mapping to my entity object attribute, even though I can select the VO to create a view accessor from the ADF library.
    Possible bug?

  • Need to see all records stored in a file

    Hello
    I have a simple question about ObjectOutputStream and ObjectInputStream.
    I have a Person class which contains infomation about a person
    When the user presses the savebutton I need to write this to file
    ***SAVEBUTTON******
    p.setName(nameTextField.getText());
    p.setAge(Integer.parseInt(ageTextField.getText()));      
    writeRecord(p);
    ***WRITERECORD***'
    openW();
    outFile.writeObject(p);
    outFile.flush();
    ***READRECORD*******
    p = (Person)inFile.readObject();           
    nameTextField.setText(((Person)p).getName());
    ageTextField.setText(new Integer(((Person)p).getAge()).toString());
    inFile.close();
    I have a read button which must show all records in my textfields.
    Pressing the read button should show the first person and then the second etc.
    But it seems that I can only see the last record entered.
    So the question is how to be able to solve this in the best way.
    Should I use an array to somehow solve this or how do I see all persons one by one?
    THANKS

    I don't see a reference to the number of records you are processing nor a reference to the amount of resources on the client side or any business rules implementations. Those may have bearings on how you choose to iimplement your display model.
    generally speaking -- when dealing with 10's of thousands or more, I prefer to use database with ResultSets and some type of caching scheme, when using small amounts of data, then you have the luxury of making in memory structures for your entire set.

  • How to retrieve all records with its all attributes???

    Hi,
    I am trying to query LDAP to get all the records with is all attributes using InitialDirContext.search method.
    But I am getting exception as "Invalid Attribute exception".
    For the search method i used filer as
    String filter = "(&( uid =* ))";
    String[] filterAttr = { "uid" };
    SearchControls searchControl = new SearchControls();
    searchControl.setSearchScope( SearchControls.SUBTREE_SCOPE );
    results = dctx.search( PPL_DN, filter, searchControl );
    Please help to resolve this...
    Thanks in Advance
    Regards,
    Peri

    Thanks for the reply,
    It is working fine now.
    I see with the outer part [(&(uid=*))] in filter is working fine in 32 bit JRE. where as in 64 bit JRE it is not working with the outer part.
    In 64 bit i changed the filter to [uid=*] and it worked fine.
    Can you please tell me why this difference is required in filter with respect to JRE.
    Thanks in advance.
    Regards,
    Peri
    Edited by: Peri K on Dec 28, 2011 8:27 AM

  • How to display a db record with a variable number of joined records

    I'm building a website for an airshow http://www.hollisterairshow.com and the organiser would like to post a list of things he needs for the show and have people respond via the website. For example, he might need 20 tents and potentially up to 20 people could respond, each offering one tent, or fewer people could each offer several tents. I'd like to create a view showing the item needed and underneath it one row for each offer he receives. I already have a couple of tables defined, one called "needs" and the other called "offers" , the "offers" table has a column called "needId" which is the index from the needs table.
    So far I have created a recordset to join the tables but each row contains the need and the offer so I'm seeing the need repeated on each row and I only want to see it once. Here's the SQL generated by DW CS4
    SELECT needs.needId, needs.title, needs.`description`, needs.quantity, needs.needMet, offers.needId, offers.offerId, offers.name, offers.email, offers.phone, offers.quantity, offers.`comment`
    FROM needs, offers
    WHERE needs.needId = offers.needId
    ORDER BY needs.title
    I'm sure there must be a simple solution to this but I'm unable to figure it out. I'm new to SQL and doing this as a volunteer for the airshow.
    Thanks,
    Tony

    Thanks so much, for pointing this out. This looks like it'll do what I need. I think I understand the code so I'll modify it and try it.
    It looks like it will create an output that looks something like this
    Need1    Offer 1
                 Offer 2
                 Offer 3
    Need 2     Offer 1
                   Offer 2
    etc....
    This is certainly workable. Ideally I'd like to create something like this
    Need 1
         Offer 1
         Offer 2
         Offer 3
    Need 2
         Offer 1
         Offer 2
    Is there a way to do this? Would I need a different recordset or am I still looking at a layout issue?
    Thanks again for the help.
    Tony

Maybe you are looking for

  • HP Officejet 7500A Wide Format - Can't reset the paper size - won't print!!!

    I have a new HP Officejet 7500A Wide Format All-in-one printer.  I love it and have had no problems with it...until now.  The other day I went into Photoshop and printed a 4x6 photo and now my printer will not allow me to print on 8.5X11.  I have che

  • How can I get INSTID_B for the documents which are stored using Store Business Document functionality

    Dear experts, I had activated the functionality of Store Business document and successfully stored documents in external server. My client have a custom function module which is used to send emails.In that FM they used SO_DOCUMENT_READ_API1, SO_DOCUM

  • Tax Remain Balance In Balance filed of MIRO

    I am using tax code V6(vat 8%),so total tax for 6000 GBP is 480 GBP ,which is correctly calculating by system  in MIRO i.e. Tax amount 480 and  Balances is 6480 ,but if I am putting 6480 in  amount field to post the amount ,some amount remain balance

  • OO4O in VB for dequeue

    I am using OO4O in VB for dequeue. When I am doing abnormal termination in VB application, dequeue monitor still exists (Session is still active in DB). So, When ever, I am doing enqueue, terminated VB queue monitor is executed and dequeued that info

  • Junior SharePoint developer

    How many hours in a SharePoint project do you need to work in order to be called as a junior SharePoint developer?