my problem is this, I am trying to select multiple tables to compare and echo out matching results. Here is an example of my code:
$s1 .= "t1.bid, ";
$s1 .= "t1.bBuilding";
$s2 .= "t2.rBuilding, ";
$s2 .= "t2.rRoom";
$query = "SELECT $s1, $s2
FROM tableOne t1, tableTwo t2
WHERE t2.rBuilding = t1.bid";
$result = mysql_query($query, $conn);
while($row = mysql_fetch_array($result))
{
echo $row['bBuilding']; // this is the only variable that will echo out
echo " :: ";
echo $row['rRoom,'];
echo "<br>";
}
This works as far as the selection however, it will only print out the first variable listed and none of the others below it. So in the above example.... 'bBuilding' will echo out correctly and 'rRoom' will not. If I was to switch these two, than the opposite would occur. Any ideas on why this is or if there is something I am not getting.
Thanks for your time.