Defining a Recordset Set based on two tables

I am having difficulty displaying records for a "membership"
page. I have set up a simple database in PHPMyAdmin with two main
tables: instructors and membership. Instructors are given a
temporary username and password to enter a restricted area. If they
decide to become a member, they go to a page with a
Pre-registration
form and fill that in. If their credentials check out, they are
sent a registration form.
The pre-registration form populates the instructors table.
I set up three pages in the Admin area: Contact_info,
Addresses, and Membership.
The Contact_info has the instructors' email and phone
numbers. This is based on some of the fields in the instructors
table. This page works fine.
The Addresses page also is populated fields from the
Instructors table and also works well.
The membership page is not working. I want this page to
display fields from the Instructors and the Membership tables.
Here's the SQL statement that I am using in the Recordset
dialog box in DW:
SELECT instructors.instructor_id, instructors.first_name,
instructors.last_name, membership.instructor_id,
membership.username, membership.pwd, membership.type
FROM instructors INNER JOIN membership ON
instructors.instructor_id = membership.instructor_id
ORDER BY instructors.last_name
It seems to me to be correct but its not displaying any
records. I don't know if the sql statement is bad or I have my
instructor_id field in my Membership table set up incorrectly in
PHPMyAdmin. I don't know how to indicate that its a foreign field
or how to relate it to the other table, other than indication the
relationship with sql. By the way, did I mention that I am new to
php and sql?
I appreciate any help.

Just and idea. 
Try to create one dimension like this:
Id
type
Category
1
juice
drink
2
milk
drink
3
alcohol
drink
4
beer
liquor
5
wine
liquor
Hope this helps.
Reeves
Denver, CO

Similar Messages

  • BLOCK BASED ON TWO TABLES

    I've created a block based on two tables.
    Querying records works fine.
    However, when I try to amend a column in the master table I get an error message 'Record has already been updated by another user.'
    I have set the dml target property to to the master table and set the primary key on the correct columns.
    What else could there be??!!

    Block1 will be----- enter_query Sku :123 then from dropdown select Level 1 which will show data like this
    in two different rows.
    Sku       : 123       Price  : $100        Qty : 10   (Primary)
    Sub Sku   : 345       Price  : $110        Qty : 8   (Level 1)then from dropdown selected Level 2 which will show data like this in two different rows.
    Sku       : 123       Price  : $100        Qty : 10   (Primary)
    Sub Sku   : 456       Price  : $90         Qty : 12 (Level 2)There are two more blocks which will display more information based on either Level 1 is selected or Level2 selected.
    Regards
    Sandy

  • One block based on two table when update/insert result in FRM-40654

    Hi,
    I ahve a multi line block based on two tables.
    Customers - AFCUSTOMER
    Maintenance - AFMAINT
    Some customers exist when maintenance doesnt so in my where clause i have
    AFCUSTOMER.CUSTID=AFMAINT.MAINT_CUSTID(+) AND AFCUSTOMER.CUSTBRANCHID=1 AND AFCUSTOMER.CUSTSTATUSID=2
    I have primary key set as the AFMAINT table primary key and have set DML data targetr name as AFMAINT.
    I am displaying customer name (from AFCUSTOMER) and type of payment (from AFMAINT) on screen and i want to change the type of payment which then uses pre update trigger to fil in the primary key of AFMAINT.
    Querying works fine and displays all records. But when i try to insert a record into the AFMAINT table by changing the type of payment list item i get FRM-40654 Record updated by another user. I have checked and block status is QUERY right before the list item is changed.
    Any ideas on where i am going wrong.

    But when i try to insert a record into the AFMAINT table by changing the type of payment list item i get FRM-40654 Record updated by another userWhen you start editing a record which is already stores in the database forms "rereads" the record from the database and check id all values in the database are the same as in the form. If there is some difference, forms assumes that someone else changed the record after you did the query.
    The main causes for that are:
    -Some database-trigger which changes the value of a column which is included in the form
    -numeric column with a higher precision in forms, than in the database
    -a block based on a view or "select from clause" which does not return the same values as inserted/updated through forms.
    I guess you run into the third issue. Check all the values in the forms-items after your dml and compare them to the values saved to the database, there will be some difference. If you find it, correct the error, if one, or re-read the data in the POST-UPDATE-trigger.

  • Detail tabular form based on two tables

    db11gxe , apex 4.0 , firefox 24 ,
    hi all ,
    i have a master detail form based on two tables , the detail form ofcourse based on one table , the problem is i want to include a column of another
    table into the tabular form , so i have changed the query of the tabular form and included the column in it correctly ,
    but the problem is about saving data , i can not save the data , i think
    because the "mru" process is based on one table , that is because i face an error talking about "mru" process when i try to save the data ,
    Error in mru internal routine: ORA-20001: no data found in tabular form Unable to process update.
    so
    what should i do to save the data ? should i create another "mru" process based on the other table or what ?
    thanks

    Anything beyond "simple" requires that you do it yourself.  I believe that what you want is "beyond simple"
    As far as I know, you can only use the 'mru' on one table.
    (I could be wrong)
    If the conditions are right, you might be able to simplify things such that you can use the 'mru'.
    ie CREATE VIEW on the two tables.
    However, you need to understand how Oracle treats DML operations on views, what type of views can be updated, etc., etc.
    If just creating the view doesn't work, creating an INSTEAD OF trigger on the view come to mind...
    (lol) - at that point, you have already started down the 'dark path' of creating your own 'MRU'
    personal note:  triggers have a really baaaddd habit of hiding code from other developers.  you are better off, in the long run, creating your own 'mru'..
    ie a package with procedures to handle INSERT, UPDATE, and DELETES
    MK

  • Can I create a view based on two tables that have the same column name?

    I have two tables A and B. Each table has 50+ columns.
    I want to create a view that includes all the columns in A and all the columns in B. I created a view with a select statement that says
    Select A.*, B.*
    From A, B
    where A.id = B.id
    It returns an error because in each table I have a column that keeps track if a record has been changed called Modified_By. That's where it chokes up on I figure. I would like to write the view without explicitly writing each column name from A and B as part of the select statement. The actual select statement works fine and only bombs when trying to turn the select statement into a view.

    You will have to type the full column list at least once. You can save a few keystrokes (i.e. alias. on every column) by providing the column names to the CREATE part instead of in the SELECT part. Something like:
    SQL> desc t
    Name                                      Null?    Type
    ID                                                 NUMBER
    NAME                                               VARCHAR2(10)
    SQL> desc t1
    Name                                      Null?    Type
    T_ID                                               NUMBER
    LOC_ID                                             NUMBER
    NAME                                               VARCHAR2(15)
    SQL> CREATE VIEW t_v (id, t_name, t_id, loc_id, t1_name) AS
      2  SELECT t.*, t1.*
      3  FROM t, t1
      4  WHERE t.id = t1.t_id;
    View created.HTH
    John

  • Define variable a ROWTYPE based on a table name passed as a parameter

    I am trying to write a procedure that processes rows for tables of differing structures. Table_name is passed as an IN parameter to the procedure. I define a cursor within the function that is defined by a SELECT * FROM table_name. I also need to define two variables, l_this_row and l_prev_row. I need to define them as table_name%ROWTYPE. Of course, table_name is a VARCHAR2 that contains the name of a table, whereas Oracle is expecting an actual table name in the declaration. How can I define these variables to make something like the code shown below compile and work properly? I am using Oracle 10gR2.
    DEFINE PROCEDURE foo(table_name IN VARCHAR2) IS
    l_this_row table_name%ROWTYPE;
    l_prev_row table_name%ROWTYPE;
    l_cursor SYSREFCURSOR;
    BEGIN
    OPEN l_cursor FOR
    'SELECT * FROM '
    || table_name
    || ' ORDER BY '
    || get_pk_col_name_for_table(table_name)
    || ', version_num'; --version_num is guaranteed to be a valid column name in every table, although the other column names vary in name, quantity, and type per table.
    LOOP
    FETCH l_cursor INTO l_this_record;
    EXIT WHEN l_cursor%NOTFOUND;
    -- dynamic comparison of l_this_record and l_prev_record and conditional processing based on the comparison occurs here
    l_prev_record := l_this_record;
    END LOOP;
    END;

    Billy  Verreynne  wrote:
    Well, one method is to keep the SQL projection consistent across the number of dynamic SQLs being dealt with. With the projection being consistent, your code does not need to guess what the row structure the column returns.Unfortunately, what I need to compare is almost everything except the primary keys. So one table might contain addresses and another might contain invoice headers. There's no way to get them into the same structure.
    Billy  Verreynne  wrote:
    This approach can also be done in a generic fashion - dealing with an arbitrary number of columns per row. This dynamic structure is more flexible, but also increases the complexity of the code that has to deal with this. For example:
    create or replace type TStrings is table of varchar2(4000);Now SQLs can be created to pass any number of columns to the code to process:
    select TStrings( empid, ename, jobid, date_employed, date_of_birth ) from emp order by empidThe code then uses the Count method of the TStrings type to determine the number of columns passed and processes that.Then the problem becomes having to specify all the column names. I need to figure them out dynamically, as in "SELECT column_name FROM user_tab_cols WHERE column_name NOT IN ('ID', 'PREV_ID', 'NEXT_ID')". It would, of course, be best if I didn't have to populate each array element with an individual SELECT in its own EXECUTE IMMEDIATE statement. That would certainly slow things down. If I were trying to write this using ADO.NET, I could reference something like table_name(row_index).columns(ix) without having to know any of the column names, and I could exclude columns by name using a reference like table_name.columns(column_index).name. (I don't recall the exact syntax, but it is something reasonably close to that.) But PL/SQL doesn't seem to have anything close to this.
    Ideally, I want to get it to where I can do something like this in a private function:
    FOR ix IN 1..TStrings.Count LOOP
       IF this_row(ix) <> last_row(ix) THEN
          RETURN FALSE;
       END IF;
    END LOOP;
    RETURN TRUE;
    Billy  Verreynne  wrote:Last comment. I have to echo what the others said. This is not optimal. Dealing with variant/dynamic structures and processing rows using PL/SQL (in a slow-by-slow fashion) does not scale well. Scalability and performance comes from processing data sets using SQL.I completely understand. I'm a big fan of replacing a lot of code with one SQL statement, but that just won't work for this problem.

  • Set list from two tables

    Hi
    I have two database tables, one lists orders and the other the customer details.
    Is it posible to set a list and update page that calls data from both tables?
    Thanks
    laurence

    Hi,
    Suppose your table are like this.
    Table 1
    CLM1 CLM2 CLM3 CLM4.
    Table 3
    CLM5 CLM6 CLM7.
    DATA: itab1 type table of Table1 with header line,
               itab2 type table of Table2 with header line.
    TYPES: begin of itab3_type,
    INCLUDE STRUCTURE table1.
    INCLUDE STRUCTURE table2.
    TYPES: end of itab3_type.
    DATA: itab3 type table of itab3_type with header line.
    Now you can loop at ITAB1 and move data of CLM1 to CLM4 to itab3.
    Then loop at ITAB2 and copy CLM5 to CLM7 to itab3.
    loop at itab1.
    move-corresponding itab1 to itab3.
    append itab3.
    endloop.
    clear itab3.
    loop at itab2.
    move-corresponding itab2 to itab3.
    modify itab3 index sy-tabix.
    endloop.
    Regards,
    Sesh

  • Can we define a view that refers to 50 tables?

    Hi,
    I've a problem at hand and I'm not sure what the right solution I can adopt.
    There is an application which hits the DB (v11.2) for accessing a single view 'XVIEW'. This view has a simple sql & join which is based on two tables XTABLE1 and XTABLE2.
    Now, the new version of the schema that has got released has split XTABLE2 into 50 different tables each having a same structure. To the fix the issue, there are two solutions I could think of:
    1. Create 50 views on top of 50 tables, and fix the Application to refer to these 50 new views; note: the application has hundreds of references and this has a significant work involved.
    2. Rewrite XVIEW to refer to 50 tables. This will avoid changing the application, however I'm not sure if this is feasible and will have a decent performance.
    I would like to go for solution 2 as it involves significantly less effort, but not sure how best i should define the view, single the 50 table structure is the same can I just union all of them?
    Thanks for the help.

    Hi,
    Hozy wrote:
    Frank, thanks for helping me out.
    What you are suggesting is that I should recreate the view XVIEW which does union all (as the rows will be unique) of the 50 tables, however performance will be an issue unless I can create a materialized views.
    What I know of materialized views is that it's used for static, pre-computed type of data. A materialized view is pre-computed; that's what makes it faster. The time and effort spent in doing the UNION is shifted from the time when you do the queries to the time when you refresh the materialized view. Whether that is more or less total time depends on how often you query the view, and how often you refresh it. At any rate, the performance when you do the queries will be as good as possible.
    Materialized views ar often used in data wharehouses, where then data may only change once a month, but they are also often used in situations like yours, where the data changes every day, or even more frequently.
    In my case, the data in few of the 50 tables might change once every 24hrs and it all comes at one time. The queries that hit XVIEW should get the latest data. Is there a way I can define a materialized view which will pick up the new data in the base 50 tables?I see; you have some job that runs at, say, 2:00 am every morning, and changes some, or maybe all, of the 50 tables. You might refresh the materialized view at, say, 4:00 am every day, or at some time when you're sure that the changes to the base tables are complete. Any query that uses the materialized view between 2:00 and 4:00 am will get stale data.
    You could, alternatively, make the materilaized view refresh whenever any of the base tables change, but this uses more resources, including your time and effort setting it up.

  • Joining Two Tables by Database View

    HI There,
    I'm trying to join two tables BNKA and LFBK to get the Bank details according to the requirement.
    Now, I wanted to go head and create a Generic datasource and bring the fields from these two tables by Vew.
    Can someone please explain me step by step to create the database view?
    One more thing, do we need to have anything in common between two tables BNKA and LFBK ?
    I really appreciate if someone can guide me through step by step method to create Database Table view?
    Thanks
    Madhuri

    Hi Madhuri,
    With out having common fields, we can not create data base view based on two tables.
    1) goto SE11
    2) select data base view and give the name and create.
    3) in left side give the tables names
    4)  In left side define the relation
    check the below article
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10a89c00-7dd7-2d10-6f83-cd24ee6d517c?QuickLink=index&overridelayout=true
    Regards,
    Venkatesh

  • Error in Abap code when combining data from two tables

    Hi,
    I got error in my code when  i try to select data based on two tables
    error message Unknown column name "(" field list. field list. field list. field list.
    select ( WLK1~ARTNR )
              into ZOXE1D0041-ZZPROMO
              from WLK1 INNER JOIN T001W
              ON WLK1FILIA = T001WKUNNR.
              where WLK1-PFLKN NE 'P' AND
              WLK1-QUELL NE '2'.
    Table 1 WLK1
    ARTNR   FILIA       PFLKN                  QUELL
    001         C001        P                           2
    002         C001        A                          1
    Table 2  T001W
    KUNNR                WERKS
    C001                    P001
    My requirement is to extract from article number from table WLK1 where the customer number (FILIA) matches with Customer number from (T001W) and plant (WERKS).
    In conclusion I like to have this only this row
    ARTNR   FILIA       PFLKN                  QUELL
    002         C001        A                          1

    Hi
    You need to append every article number after each select is performed
    is this an intermal table ZOXE1D0041 with header line ? if yes
    then do this way
    select WLK1~ARTNR
    into ZZARTICLE
    from WLK1 INNER JOIN T001W
    ON WLK1FILIA = T001WKUNNR
    where WLK1~PFLKN NE 'P' AND
    WLK1~PFLKN NE 'S' AND
    WLK1~QUELL NE '2'.
    ZOXE1D0041-ZZLISTARTICLE = ZZARTICLE.
    Append ZOXE1D0041.  " <edited>
    endselect.
    then ZOXE1D0041 will have all article numbers.
    Edited by: Sonal Patel on Sep 5, 2009 10:27 AM

  • Question - View with a join based on two unequal strings.

    Hello -
    First my apologies for the likely novice question.
    I'm creating a view based on two tables as such:
    SELECT *
    FROM table1 LEFT OUTER JOIN table2 ON table1.string = table2.string AND table1.number = table2.number
    Problem: table1.string looks like "A00A01%%%" and table2.string looks like "A1" (which would correspond to "A00A01%%%".
    Question: Can I create the join based on the 4th and 6th character of the string = the other string, or should I create a view with a formula creating a new field and then create a second view? (Note: creating or changing the field in the original table is not an option).
    Thank you.

    Hi,
    Yes, you can do that. Join conditions don't have to be as simple as "ON a.col1 = b.col2"; they can involve functions, like CONCAT and SUBSTR.
    For example:
    FROM            table1
    LEFT OUTER JOIN table2
    ON              SUBSTR (table1.string, 4, 1)
                    ||
                    SUBSTR (table1.string, 6, 1) = table2.string
    ...The query might be faster if you create a function-based index on the join condition from table1. This does not require changing table1 itself. (For a LEFT OUTER JOIN, like this, it probably won't matter.)

  • Line Chart - getting data from two table to behave as 1 data series

    I'm using the 'Personal Budget' template, and have two tables titled 'Annual Budget by Month: 2009' and 'Annual Budget by Month: 2010'. These tables show, as their last row, my total savings. I want to set up a line chart to display the (downward) trajectory of my savings in one continuous line.
    However, if I create a line chart, the two data sets from the two tables are displayed as two lines, one below the other. If I convert it to a column chart, and then switch to columns instead of rows as the Plotting Orientation (data series button in the upper left of the table), the columns do display correctly. Can anyone tell me how I can get the line version to work?

    spiff,
    I think the solution to your problem is to create a summary table that gathers the data from all your month tables, then plot the summary. Remember to put the category names into a Header row or column so they will automatically show up on the chart axes.
    Jerry

  • Correlation set based on Human task - receive activity

    Hello everybody,
    is it possible to define a correlation set based on a receive activity of an human task?
    Thanks, Chris

    Are you trying to set "Create with parameters" as default task flow activity ? in that case open the the task flow diagram , right click "Create with parameters" data control -> Mark Activity -> Default Activity.

  • One renderer and two tables problem

    Hi!
    Here is my problem.
    I got one table that use a CellRenderer, and it works very fine.
    I've added one other table on my interface, and I want it to use the same renderer, because it has to work like the first table.
    The problem is that the rendering of the second table doesn't work at all.
    The cells are displayed, but the few displaying changes (color, truncation, unit ..) are not applied on it.
    When I try to watch what the renderer do, I can't see any work on this second table..
    I'm starting to think that a renderer can't be used on two differents table.
    But it can't be, no?
    the renderer is setting on the two tables like the following :
    myTable.setDefaultRenderer(myObject.class,new CellRenderer());

    * LabelCellRenderer.java      Tiger     2005 May 06
    package com.yahoo.ron.examples;
    import java.awt.Color;
    import java.awt.Component;
    import javax.swing.JLabel;
    import javax.swing.JTable;
    import javax.swing.table.TableCellRenderer;
    * @author     Ronillo Ang
    * @version     vm1.5.0-b64
    public class LabelCellRenderer extends JLabel implements TableCellRenderer{
         public LabelCellRenderer(){
              setOpaque(true);
         public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col){
              if(isSelected)
                   setBackground(Color.BLUE);
              else
                   setBackground(Color.WHITE);
              if(value instanceof String)
                   setText((String)value);
              else
                   setText("Unknown value");
              return this;
    * TestLabelCellRenderer.java     Tiger     2005 May 06
    package com.yahoo.ron.examples;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.TableColumnModel;
    import javax.swing.table.TableColumn;
    * A class that show how to apply and share a cell renderer
    class TestLabelCellRenderer{
         static public void main(String[] args){
              JFrame frame = new JFrame("Test - Label Cell Renderer");
              JTable table = new JTable(new com.yahoo.ron.table.UneditableTableModel(new com.yahoo.ron.RandomValues()));
              TableColumnModel columnModel = table.getColumnModel();
              TableColumn column = columnModel.getColumn(1);
              LabelCellRenderer lcr = new LabelCellRenderer();
              column.setCellRenderer(lcr);
              frame.setLayout(new java.awt.GridLayout(2, 1));
              frame.add(new JScrollPane(table));
              table = new JTable(new com.yahoo.ron.table.UneditableTableModel(new com.yahoo.ron.RandomValues()));
              columnModel = table.getColumnModel();
              column = columnModel.getColumn(2);
              column.setCellRenderer(lcr);
              frame.add(new JScrollPane(table));
              frame.pack();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setVisible(true);
    }I hope this will help.
    NOTE: This program needs to be modify before it is run. I intend to do that.
    God bless you!

  • Please help with two tables...

    I've created form based on two tables - two blocks with relationship. One table have fields ID and DESCRIPTION and there is LOV based on it. LOV returns value to textbox. I want that user see in textbox value DESCRIPTION, but when user save changes to main table there is update on ID field. How can I do that?
    PS Sorry my english is not perfect.

    see this link , i guess you are looking for same thing
    Copying value from updated block to newly created bolck

Maybe you are looking for

  • Using USB dongle with tablet to install from WDS

    Is it possible to install an image via WDS to a tablet without an ethernet cable by using a USB>ethernet dongle?

  • IPod USB charging when iBook/Powerbook is sleeping

    Hello all. We've got two iPods (a 5G and a 4G) and two portable Macs (PowerBook and iBook). Here's the issue: when our computers are sleeping (ie. the lids are closed), but also plugged into the wall, we could charge our old 4G iPods using the FireWi

  • How Do I Print Clear Text?

    Hi, I'm new to this forum and new to Java in general, so please bear with me. I am writing a desktop application that returns textual data in a complex table format. The user needs to be able to edit the data once it is returned, so I display the dat

  • Plantage du programme

    Bonjour Depuis peu, lorsque je charge un projet, Adobe Premiere plante et je ne sais plus quoi faire. Je l'ai déjà désinstallé 2 fois. Recently, when I load a project, Adobe Premiere stops and I do not know what to do. I have uninstalled 2 times.

  • Why cannot iTunes sync movies from iPhoto taken with iPhone

    I take little movies with iPhone. (5Mb) iPhoto copies then to the Mac with the Photos. Movie plays in iPhoto. In iTunes I say Sync event and tick include videos on. The movies are not copied back to the iPhone. Checked in iPhoto, event says 18 items