Jump to content

Using data from the same table twice


Recommended Posts

I use DWMX, PHP and mySQL.

Using an insert form I am entering data in an event table--where a record contains, among other entries from various tables, two different entries from the same table (name of contact person 1 and name of contact person 2 coming from a table of contact people using list/menu option). When I display the content of the event table in the repeat area the recordset is supposed to list contact people data (fname, lname) but instead of listing two different data for two different individuals it repeats the data for the first contact person twice. I checked in myphpadmin and the event table has the data entered and stored properly (I store indices refering the data in the contact table for these two individuals) but in the process of specifying what to display in DWMX I end up with the same result twice since with DWMX I am unable (I do not know how) to differentiate fname, lname for the first contact person from fname, lname for the second individual.

Would you please recommend the proper way to do it in DWMX? I do not want to keep two different tables with the same data (one for contact people 1 and second for contact people 2, it is the same group of people after all).

Thank you.

Link to comment
Share on other sites

I do not see how you can list the names if you store the index number.

 

Is there an option in DW that would handle listing two entries from one table in a single resordset? I was thinking about using aliases for that table but at the end you end up in the DW listing something that does not differentiate between two entries--in the definition of recordset rsEventData it seems like the alias is working but later whent displaying the recordset the name of the table is dropped and the script looks like this:

 

<?php echo $row_rsEventData['contactfname']." ".$row_rsEventData['contactlname']; ?>

<?php echo $row_rsEventData['contactfname']." ".$row_rsEventData['contactlname']; ?>

 

Since the name of the table /aliases are not mentioned the two will result in duplicate output.

 

Please help. Thank you.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.