Linking 2 tables - PHP

I have 2 tables that are linked by user_name.  They both have fields that are either yes or no.  I want to take all the "yes" and certain users from table 1.  Then take the users from that table that selected yes and compare them to table 2 and if they marked "yes" there, display certain fields from both tables.  I have the data in a repeat region.  I tried to do it with a recordset and even 2 recordsets and it's not working.  Anyone help?

Ok, how do I join both tables with user_name?  Let me explain it better:
Table 1 - Get Records WHERE user_name = X AND approved = 'yes'
Table 2 - Get Records WHERE(want to pull only user_names from Table 1) WHERE accepted = 'yes'
I want some fields from both tables and be able to put them in a repeat region.  Hope that makes sense.  Any help is appreciated.

Similar Messages

  • Linking Access tables, creating a query with using both Access and Oracle

    Hello,
    I am using 3.0.04.34 version Oracle Developer. I am supposed to create a script/procedure to use both Access tables and oracle tables together. There is an option in developer to copy the access tables into oracle. But it doesn't help me. Because when we updated the access tables
    the copied ones are not be updated. How can I created a linked access tables to oracle and create a query with using both access and oracle table together.
    I will appreciate if you guys help me. I look forward to hearing from you guys.
    Thanks,
    Pinar

    Pinar,
    to be able to query MS Access tables in Oracle you need an additional product, the Oracle Database Gateway for ODBC. It allows you to link any foreign database into an Oracle database using a suitable ODBC driver. You can then access the MS Access tables through a database link based on the Database Gateway for ODBC. This will also allow you to join local Oracle and remote MS Access tables from your Oracle database.
    There's a note on My Oracle Support which gives you more details:Document 233876.1 Options for Connecting to Foreign Data Stores and Non-Oracle Databases - For example - DB2, SQL*Server, Sybase, Informix, Teradata, MySQL
    And there's also a dedicated Forum: Heterogeneous Connectivity

  • Linking SD tables in SAPquery

    Hi Everyone,
    I'm in the middle of creating a SAPQuery for my users to use. However, i am having trouble in linking a particular table, as i get the following error message:
    "Table KONV cannot be used in a join"
    What i am trying to do is to link SD tables VAPMA, VBRP, VBRK, KNA1 with KONP. The problem now is that i am unable to link KONP with the earlier mentioned tables, so i need to include another new table KONV to provide a link between them.
    From what i can find out in SE11, KONV is a cluster table, so does it mean there is no way to link them?
    Is there any other way to link those 4 earlier tables i mentioned with KONP?
    Thanks in advance

    Hi Bernard,
    Please check this link perhaps it may help to link above tables.
    http://www.sapgenie.com/abap/tables_sd.htm
    Regards,
    Ferry Lianto
    Please reward points if helpful.

  • Link between table SOFFPHF and FI document

    Hello Experts,
    I have a requirement to find all the FI documents with the attachement .
    We have a table SOFFPHF (SOFF: Files of Physical Information Objects) where i can get the details of attachement, But now how to link this table with the FI document which has this attachement.
    I tried the link using table SRGBTBREL , But i am not getting entries from table SOFFPHF in this table.
    Thanks.
    Regards,
    Ganesh.

    Hi Shivkumar,
    When you enter the item category as 'D'then a purchase order is
    classified as a service purchase order.
    When you use ML81N to perform a service entry, then automatically
    the GR document is generated.The basis for this is a service can
    only be performed and cannot be stored.
    The PO history table will give you a good idea of the relation.
    You can check the EKBE table.Enter the service entry sheet number
    in the field LFBNR of EKBE table, enter the SES number, you will
    see all the documents associated with it.

  • In ER DIagram using toad( how can i link two tables)

    Hi,
    Any Toad expert can guide me that how can i link two tables in Toad in ER Diagram to show the relationship between two tables.
    Thanks

    Hi,
    I hope there is foreign key relationship in tables, if so then you can click on "Find table dependencies" icon which will draw lines between them.
    ~Vinod

  • Query Builder - How to create a link between tables with many fields?

    I have many fields in my tables. When the query builder loads the tables, the tables are expanded to accomodate all the fields. Suppose I want to link Table A's Customer ID (the first field in Table A) wiith Table B's Customer ID (the last field in Table B). How can I do that if the last field in Table B are not visible in the screen?
    Currently, I create a link in Table A's customer with a random field in Table B. Then I edit the link to create a proper condition. Is there a more efficient way to do this?
    Thanks.
    Edited by: woro2006 on Apr 19, 2011 9:40 AM

    Hi woro2006 -
    Easiest way is to grab Table A's title bar & drag Table A down the page until the columns you want to link are visible.
    FYI, there is an outstanding bug
    Bug 10215339: 30EA1: MISSING THE 2.1 RIGHT CLICK OPTIONS ON DATA FIELDS TO CREATE A LINK
    to add a context menu on the field for this. That is, Link {context field} to > {other data sources} > {fields from that source}
    It is being considered for 3.1, but I have no idea where it will end up in the priority queue.
    Brian Jeffries
    SQL Developer Team
    P.S.: Arghh, Unfortunately, I just tried it and the diagram does not auto scroll while you drag, so there is some guess work/repositioning the view involved.
    Logged Bug 12380154 - QUERY BUILDER DIAGRAM DOES NOT AUTO SCROLL WHEN DRAGGING TABLE

  • Linking same table together syntax problem

    Hi All
    I've never had to link a table to itself before, but as I try and do it now I keep getting "missing keyword" error message at the point I try and assign a different name to the second instance of my table. Can anyone point out my mistake please?
    Here is the SQL:
    SELECT FSA_CO, FSA_NO, FSA_ADESC, FSA_MFNO, FSA_SREF, ERE_RET.ERE_BELONGS_TO, ERE_RET_1.ERE_DESC
    FROM (FSA_ACC LEFT JOIN ERE_RET ON FSA_ACC.FSA_HIRE_GRP = ERE_RET.ERE_ID) LEFT JOIN ERE_RET AS ERE_RET_1
    ON ERE_RET.ERE_BELONGS_TO = ERE_RET_1.ERE_ID WHERE (((FSA_ACC.FSA_CO)='01') AND ((FSA_ACC.FSA_NO)='P008'))
    Many thanks in advance
    Chris

    Well, the regular Oracle syntax would be
    SELECT fsa_co,
           fsa_no,
           fsa_adesc,
           fsa_mfno,
           fsa_sref,
           a.ere_belongs_to,
           a1.ere_desc
      FROM fsa_acc, ere_ret a, ere_ret a1
    WHERE fsa_acc.fsa_hire_grp = a.ere_id
       AND a.ere_belongs_to = a1.ere_id
       AND fsa_acc.fsa_co = '01'
       AND fsa_acc.fsa_no = 'P008'I think the AS is what it's complaining about - it didn't care for it in regular syntax.

  • Link between tables mseg and afvv

    Dear Sap Gurus,
    I need a report in which i can get production order wise production and cunsumption for all production order
    operations in a single report.
    i just want to know how to link mseg table in which i am having batch wise production and consumption with afvv table
    or any else in which  i can get operation nos of production order.
    Thanks and regards
    Shankar

    Hi,
    AFVV - AUFM by AUFPL as told above is best way, otherwise to join MSEG, you can use field AUFNR in tables MSEG & AUFM and further AUFPL to join AUFM & AFVV.
    Regards
    Trin

  • Query for Linking Two Tables without Reference

    Hi Folks,
    Good Day!
    I have this dilemma on how to link two tables without a reference. In the Business Partner Master Data, there is a field for the Territory which is from the table OTER. This OTER focuses on its description. Once you have added the particular Territory for that Business Partner, it is being stored in the Territory field of the BP right? Our client wants to have an automated way of searching for the Business Partner's Profit Center in creating a Sales Order wherein it is the same as the Business Partner's Territory. The Profit Center is from the table OPRC.
    When I create a Sales Order, after I have entered the Business Partner/Customer Code, the Profit Center should have the value of the Profit Center Code wherein it is the Business Partner's Territory. My query will go like this:
    Enter the BP/Customer Code automatically the Profit Center code where Profit Name = BP's Territory.
    OTER and OCRD don't have connections. How can it be?
    I'm thinking of retrieving the Territory first before the Profit Center but can you suggest of any other way?
    Thank you much!
    Regards,
    Fringe

    Hi Fringe,
    Okay, I already understood your case here. I presume your configuration as follows:
    OTER (Territory)
    territryID - descript
    1 - Philippine
    2 - Indonesia
    3 - Germany
    OPRC (Cost Centre)
    PrcCode - PrcName
    25 - Philippine
    33 - Indonesia
    47 - Germany
    Was above illustration correct? Then, you could use this formatted search in Cost Centre / Dimension field in Sales Order rows
    SELECT PrcCode FROM OPRC WHERE PrcName=(
    SELECT TOP 1 descript FROM OTER T0
    INNER JOIN OCRD T1 ON T0.territryID=T1.Territory
    WHERE T1.CardCode=$[OCRD.CardCode.0])
    However, I suggest you use a little bit different approach here. Since you can't define Territory Code / Territory ID (you could only type the Territory name, Philippine etc.), why don't you standardize Territory name with Cost Centre code? Let say, you define Philippine as PHI, Indonesia as INA, Germany as DEU and so on. Therefore, user can read the Cost Centre or more precisely Distribution Rules in Sales Order form in more familiar way.
    OTER (Territory)
    territryID - descript
    1 - PHI
    2 - INA
    3 - DEU
    OPRC (Cost Centre)
    PrcCode - PrcName
    PHI - Philippine
    INA - Indonesia
    DEU - Germany
    When FMS worked in Sales Order document, your user will read PHI instead of 25, should be more familiar to them. With that being said, you could use simpler FMS
    SELECT descript FROM OTER T0
    INNER JOIN OCRD T1 ON T0.territryID=T1.Territory
    WHERE T1.CardCode=$[OCRD.CardCode.0]
    You only need to maintain consistency between Territory Name and Cost Centre code. Just my two cents. Hope this help.
    Best Regards,
    Hendry Wijaya

  • How to link a table cell?

    Hi,
    What would be the best way to link this table cell? I want the entire cell to be linked rather than just the text inside it.
    <table width="160" border="0" align="right" cellpadding="5" cellspacing="0" class="backgroundbox-video">
                          <tr>
    <td width="167" align="left" valign="top"><p class="navheader-lg">Video Clip</p>
                                <p class="navheader-sm">Watch a short<br />
                                  testimonial video</p></td>
                          </tr>
    Thanks so much
    Laura

    Here is what I have in the style sheet...
    .vidA a {
        text-decoration: none;
        display:block;
        background-image: url(../images/videoclip-imageandcolor-tr.gif) no-repeat scroll right bottom;
        background-color:#B1D6D5;
        padding:10px;
    .vidA a:link, .vidA a:visited, .vidA a:hover{
        color:black;
    .vidA a:hover{
        background-color:#4AA3C9;
    .vidA p {
        margin:5px;
    .audioA a {
        text-decoration: none;
        display:block;
        background-image: url(../images/audioclip-imageandcolor-tr.gif) no-repeat scroll right bottom;
        background-color:#B1D6D5;
        padding:10px;
    .audioA a:link, .vidA a:visited, .vidA a:hover{
        color:black;
    .audioA a:hover{
        background-color:#4AA3C9;
    .audioA p {
        margin:5px;
    and here is what I have for those tables...
    <td align="right" valign="top" bgcolor="#FFFFFF"><table width="160" border="0" align="right" cellpadding="5" cellspacing="0" class="backgroundbox-video">
                          <tr>
                            <td class="vidA" width="167" height="100" align="left" valign="middle"><a href="http://www.12results.com/video1.html" onclick="MM_openBrWindow('http://www.12results.com/video1.html','','width=400,height=400');return false">
          <span class="navheader-lg">Video Clip</span><br />
          <span class="navheader-sm"><br />
          Watch a short<br />
          testimonial video</span></a></td>
                          </tr>
                        </table></td>
                      </tr>
                      <tr>
                        <td align="right" valign="top" bgcolor="#FFFFFF"><table width="160" border="0" align="right" cellpadding="5" cellspacing="0" class="backgroundbox-audio">
                          <tr>
                            <td class="audioA" width="167" height="100" align="left" valign="middle"><a href="http://www.12results.com/video1.html" onclick="MM_openBrWindow('http://www.12results.com/video1.html','','width=400,height=400');return false"> <span class="navheader-lg">Audio Clip</span><br />
                                  <span class="navheader-sm"><br />
                                  Listen to a 40 min<br />
    interview about SAW</span></a></td>
                          </tr>
                        </table></td>
    ---I completely removed the styles for those tables (was background-video, background-audio) because all it had was the background styling (which you said to remove) and can't see any other reason to have it there?
    So it's perfect except for the background images are not showing...so did I do something wrong in the fireworks/make transparent process do you think?
    Thanks...
    Laura

  • Link fact tables?

    hi all,
    I have two fact tables – charges and payments and both these fact tables are in the cube (as measure groups). On the relational side, these two fact tables are “linked” by a column called trans_no. Linking these two tables could be little tricky because
    a single charge can have multiple payments.
     for example, let’s say there was a charge of 100$ but the payment was done in two installments so there is one row in the charge fact table, but 2 rows in the payment fact table – both rows have the same transaction number but different date.
    It is also possible to have two charges in the charge fact table with the same transaction number but one payment in the payment fact table. So I think this is a many-to-many relationship.
    How can I link these tables in SSAS? I would to be able to show payments and charges side by side down to the transaction level. Please advise and thanks for the help.

    thank you Ken, so i am going to have  dimensions then? -
    1. off of payments
    2. off of charges
    3. "Transaction" dimension
    The reason i am saying i need #1 and #2 is because i need some other attributes such as "transaction type"(void etc) from both the fact tables. does this sound correct? i feel like i am cluttering the cube :(

  • Link of table EKKO,EKPO,EKET,KONV

    Hi Experts,
    Now , i am writing a program to print purhchase order, and i met 2 problems.
    1.why it is different price between 'net price' and 'condition price'? sometimes, they are different.
    2.the net price always is wrong. so i need to get the price in condition tab in item detail.
    i sent a OSS to SAP, they told me the talbe KONV is a cluster table, so it can not be join in .
    but i need get the exact and correct price from KONV,
    would somebody please give me the link of table EKKO,EKPO,EKET and KONV?
    our system is AFS SAP. we use me23n to display the purchase order.and there is a request we must group the item by MATNR  with the same price and ex factory date (j_3aexfcp).
    thanks

    thanks first,
    yes , i fetch the data from EKKO,EKPO,EKET first, and alreayd group by them as our user request,but the problem is i can not get the item number (kposn) exactly,  the following are the code. i do not add the item number in it, it will make the wrong result .
    after group them, some different items were grouped,so i do not know how to fetch the item number exactly.
    SELECT DISTINCT EKKOEBELN EKKOBEDAT EKKOLIFNR EKKOZTERM EKKOWAERS EKKOVERKF EKKOTELF1 EKKOINCO1 EKKOINCO2 EKPOMATNR EKPOTXZ01 EKPOJ_3APGNR
    EKPOJ_3AVDAT EKPOj_3aexfcp EKPOBPRME EKPOPEINH EKETEINDT Sum( EKETMENGE ) AS SumOfMENGE EKETMEINS EKETJ_3ASIZE EKPOLOEKZ ekkoknumv
    Avg( EKETJ_3ANETP ) AS AvgOfJ_3ANETP Avg( ekponetpr ) as Avgofnetpr Sum( EKETJ_3ANETW ) AS SumOfJ_3ANETW J_3APGENJ_3AKORD1 J_3APGENJ_3AKORD2 J_3APGENJ_3AKORD3 J_3APGEN~J_3AKORDX
    INTO (EKKO_EBELN,EKKO_BEDAT,EKKO_LIFNR,EKKO_ZTERM,EKKO_WAERS,EKKO_VERKF,EKKO_TELF1,EKKO_INCO1,EKKO_INCO2,EKPO_MATNR,EKPO_TXZ01,EKPO_J_3APGNR,
          EKPO_J_3AVDAT, EKPO_j_3aexfcp, EKPO_BPRME,EKPO_PEINH,EKET_EINDT,SUMOFMENGE,EKET_MEINS,EKET_J_3ASIZE,EKPO_LOEKZ,ekko_knumv,
          AVGOFJ_3ANETP,AVGOFNETPR,SUMOFJ_3ANETW,J_3APGEN_J_3AKORD1,J_3APGEN_J_3AKORD2,J_3APGEN_J_3AKORD3,J_3APGEN_J_3AKORDX)
    FROM
    ( ( EKKO INNER JOIN EKPO ON ( EKKOEBELN = EKPOEBELN ) AND ( EKKOMANDT = EKPOMANDT ) ) INNER JOIN EKET ON ( EKPOEBELP = EKETEBELP ) AND ( EKPOEBELN = EKETEBELN ) AND ( EKPOMANDT = EKETMANDT ) ) INNER JOIN J_3APGEN ON ( EKET~J_3ASIZE =
    J_3APGENJ_3AKORDX ) AND ( EKPOMANDT = J_3APGENMANDT ) AND ( EKPOJ_3AVDAT = J_3APGENJ_3AVDAT ) AND ( EKPOJ_3APGNR = J_3APGEN~J_3APGNR )
    GROUP BY
    EKKOEBELN EKKOBEDAT EKKOLIFNR EKKOZTERM EKKOWAERS EKKOVERKF EKKOTELF1 EKKOINCO1 EKKOINCO2 EKPOMATNR EKPOTXZ01 EKPOJ_3APGNR EKPOJ_3AVDAT EKPOj_3aexfcp EKPOBPRME EKPOPEINH EKETEINDT EKETMEINS EKETJ_3ASIZE EKKOMANDT
    J_3APGENJ_3AKORD1 J_3APGENJ_3AKORD2 J_3APGENJ_3AKORD3 J_3APGENJ_3AKORDX EKPOLOEKZ ekkoknumv
    HAVING
    EKKOEBELN = ZEBELN AND EKPOMATNR = IT_EKPO1-MATNR AND EKPOj_3aexfcp = it_ekpo1-j_3aexfcp AND EKPOLOEKZ <> 'L'
    ORDER BY EKET~J_3ASIZE.
    after fetch the date , i select the KBETR from KONV, the item number is the last important problem.
    select single kbetr into kbetr from konv where knumv = ekko_knumv and krech = 'C' and kposn = ?(i can not fetch exact item number) and ZAEHK = eket-etenr .
    any further reply? thanks very much for your reply.

  • Link in tables for characteristic of a materials in VA03

    Hi Experts,
    I have to create a report in which i have to show few charateristics of a material which is in items of a sales order in transaction VA03. i.e Select a material & click on item detail:configuration buttob below that item detail table control.
    It wil open a new table control which wil show the charateristics like color etc. I have to show those in my report but i am not getting where these values are stored & how to relate those values to the sales order.
    I found few tables like CABN, CAWN etc but no one links to the Sales order number.
    Please tell me by which field i can link these tables to my sales order number.
    Regards,
    Nik

    Get the CUOBJ field from VBAP table.
    Pass this to INSTANCE variable  to the FM VC_I_GET_CONFIGURATION.
    Characteristics of a material can be determined using
    CUD0_CONFIGURATION_FROM_DB or
    CUD0_GET_CHARACTERISTICS.
    Hope this helps.
    Thanks,
    Balaji

  • Link between table BSEG and BSET

    Helo All.
    Can you please tell me what is the link between tables BSEG and BSET in FICO?
    Regards

    Hi
    Please check below thread Ramesh answerd for same query
    Relation between RSEG Table and BSET Table
    Thanks,
    Syf

  • Error in MSACCESS linking a table with XMLTYPE

    hi all,
    I've linked a table from Oracle 9i to MSACCESS 2000 in windows 2000; this table has an XMLTYPE field, which is maped like OLE Object in Access;
    when I try to edit the table (not the xmltype field, any field...) I get an error:
    MSACCESS has generated errors and will be shutdown by windows. You must restart the program.
    An error register will be created
    anybody knows?
    thanx

    Nothing. Forms does not support this datatype.
    Frank

Maybe you are looking for