This one seems like it should be easy, but I can't get anything to work. I
have two tables. I want to pull a first name and last name from each table,
a master table and a new table. Then, I want to list them in a specific way:
I want to list the first name of the master table, then list all the names
from the new table, then i want to move to the second name in the master
table, and list all the names in the new table again, and so forth until I
have listed all combinations.

I have been able to list the first name from the master table, and all the
names from the new table, but the loop stops right there. It won't go to the
second name in the master and relist all the names from the new table. I
suspect I need a "foreach" instead of a "while," but I am just learning the
importance of arrays so I am not real good with the syntax as yet.

Any help is greatly appreciated. Here's the code:

while ($row_new = mysql_fetch_row($res_master))
      {

      while ($row_old = mysql_fetch_row($res_new))
      {
           echo($row_new[0] . $row_new[1]);
           echo($row_old[0] . $row_old[1] . "<br>");
      }
}




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to