2
I almost never use joins. My DB instructor didn't get too much into them, and one DBA I used to work with found their behavior less than optimal on some systems. In my case, I found it very difficult to follow JOIN statements when dealing with more than two tables.
I've always done an extended SELECT statement whenever I've needed to return one row with values from two:
// Look for and list intros for each mount point.
$query2 = "SELECT x.sequence as sequence, x.intronum as intronum, y.filename as filename ";
$query2 .= " FROM ".$xoopsDB->prefix("uhqiceauth_intromap")." x,";
$query2 .= $xoopsDB->prefix("uhqiceauth_intros")." y ";
$query2 .= " WHERE x.server='".$row['server']."'";
$query2 .= " AND x.port='".$row['port']."'";
$query2 .= " AND x.mount='".$row['mount']."'";
$query2 .= " AND x.intronum=y.intronum";
$query2 .= " ORDER BY sequence";
What makes the join is the second to last line: "AND x.intronum=y.intronum", which joins the tables together.
Unless of course, I'm misunderstanding the problem.
++I;