淄博网站推广,wordpress站内链接跳转,科技有限公司名称大全,装修图纸设计图我有一个输出类列表的while循环.在类数据库中,教师名称由用户数据库中的教师ID确定.这是我的数据库结构.Classes Database-----------------------------ID CLASS TEACHER1 product design 3User Database-----------------------------ID NAME3 John Doe因此,当列出我的类时,我…我有一个输出类列表的while循环.在类数据库中,教师名称由用户数据库中的教师ID确定.这是我的数据库结构.Classes Database-----------------------------ID CLASS TEACHER1 product design 3User Database-----------------------------ID NAME3 John Doe因此,当列出我的类时,我需要它将“3”转换为“John Doe”.这是我目前的代码$classdetails mysql_query(SELECT * FROM class);while($class mysql_fetch_array($classdetails)) {$marklist_class $class[class];$marklist_teacher $class[teacher]; //This is a userid//------Somewhere here i need to get the userid and look it up in the user databaseif($marklist_class) {} else {echo $marklist_class . . $marklist_teacher;}}}?我理解只是放入另一个mysql查询会降低性能并且不建议,所以如何在不向while循环中添加查询的情况下查找每行的用户数据库.谢谢.