Code: Select all
$sqlAdvisors = "SELECT tblFaculty.fac_name
FROM tblFaculty
RIGHT JOIN tblStudFac ON tblFaculty.fac_id = tblStudFac.fac_id
WHERE tblStudFac.stud_id = 4";Finally, just trying anything I could think of, I tried inserting "as facName":
Code: Select all
$sqlAdvisors = "SELECT tblFaculty.fac_name AS facName
FROM tblFaculty
RIGHT JOIN tblStudFac ON tblFaculty.fac_id = tblStudFac.fac_id
WHERE tblStudFac.stud_id = 4";My question is this:
Neither Meloni's PHP, MySQL and Apache nor Welling and Thomson, PHP and MySQL Web Development seem to say anything about such a move being necessary. So
--is this move in fact necessary, given that the query works fine from the mysql command line?
--if so, how would one find this out other than by trial and error?
--or did the query actually run right in PHP but there's a trick to extracting the result that I'm missing?
Thanks.