utahfriend Posted January 4, 2011 Share Posted January 4, 2011 My client wants me to add some detail to a program that someone else wrote. The table has three fields that are relavent: member_number, name, sponsor_number The sponsor_number corresponds to a record in the same table where member_number is the same as the sponsor_number The client wants a report that will list all the members as such: $member_number - $name - $Sponsor_number $sponsors name (name relating the the member_number which matches the sponsor_number) The code that is in use now to list the members (does not list the sponsors name, which I need to find out how to add that): while ($q->next_record()) { $j++; if ($j == 1) $t->set_var("nr_lvl", ' <tr> <td colspan="7" bgcolor=#efefef>Level 1</td> </tr>'); else $t->set_var("nr_lvl", ""); $t->set_var("id", $q->f("id")); $name = $q->f("first_name")." ".$q->f("last_name"); $t->set_var("name", $name); if (get_setting("downline_em")) { $t->set_var("email", "<td>Home: ".$q->f("home_phone")."<br>Cell: ".$q->f("cell_phone")."</td><td>".$q->f("email")."</td>"); } else {$t->set_var("email", "");} $sponsor = $q->f("first_name")." ".$q->f("last_name"); $t->set_var("sponsor", $sponsor); $t->parse("downline_rows", "downline_row_file", true); } How is the best way to pull the name of the sponsor in the middle of the above list function? Quote Link to comment https://forums.phpfreaks.com/topic/223341-reference-a-different-record-of-the-same-table-during-a-list-program/ Share on other sites More sharing options...
utahfriend Posted January 4, 2011 Author Share Posted January 4, 2011 Nevermind, I found a solution myself Quote Link to comment https://forums.phpfreaks.com/topic/223341-reference-a-different-record-of-the-same-table-during-a-list-program/#findComment-1154906 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.