leszekmk Posted January 9, 2004 Share Posted January 9, 2004 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. Quote Link to comment https://forums.phpfreaks.com/topic/1607-using-data-from-the-same-table-twice/ Share on other sites More sharing options...
shocker-z Posted January 9, 2004 Share Posted January 9, 2004 hey take a look at http://www.phpfreaks.com/forums/index.php?showtopic=13236 its another of my posts and you may see how it lists all the rows in a table. Quote Link to comment https://forums.phpfreaks.com/topic/1607-using-data-from-the-same-table-twice/#findComment-5259 Share on other sites More sharing options...
leszekmk Posted January 11, 2004 Author Share Posted January 11, 2004 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. Quote Link to comment https://forums.phpfreaks.com/topic/1607-using-data-from-the-same-table-twice/#findComment-5272 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.